summaryrefslogtreecommitdiffstats
path: root/Source/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-07-28 13:08:29 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-07-28 13:08:40 (GMT)
commit8268fc8661e54d03b02abf677c7f4afdb021e14e (patch)
treedc47bc9803c256fa9c216b8c5e876f8b4d0f635d /Source/CMakeLists.txt
parente1699f123e6968eab5a1c1fe2336c0ce8258b3a1 (diff)
parent78bbd585451752e7b23eafbfa1dc009fd5cda750 (diff)
downloadCMake-8268fc8661e54d03b02abf677c7f4afdb021e14e.zip
CMake-8268fc8661e54d03b02abf677c7f4afdb021e14e.tar.gz
CMake-8268fc8661e54d03b02abf677c7f4afdb021e14e.tar.bz2
Merge topic 'cxx-atomic'
78bbd58545 Source: Link libatomic when needed on Linux 32-bit ARM Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !8663
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