summaryrefslogtreecommitdiffstats
path: root/Source/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Source/CMakeLists.txt')
-rw-r--r--Source/CMakeLists.txt10
1 files changed, 3 insertions, 7 deletions
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index a067766..6581e0d 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -981,13 +981,9 @@ if(WIN32 AND NOT CYGWIN)
list(APPEND _tools cmcldeps)
endif()
-if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR MATCHES "sparc")
- # the atomic instructions are implemented using libatomic on some platforms,
- # so linking to that may be required
- check_library_exists(atomic __atomic_fetch_add_4 "" LIBATOMIC_NEEDED)
- if(LIBATOMIC_NEEDED)
- target_link_libraries(CMakeLib PUBLIC atomic)
- endif()
+# Some atomic instructions are implemented using libatomic on some platforms.
+if(CMake_HAVE_CXX_ATOMIC_LIB)
+ target_link_libraries(CMakeLib PUBLIC atomic)
endif()
# On Apple we need CoreFoundation and CoreServices