mirror of
https://github.com/reactos/CMake.git
synced 2024-11-27 21:41:03 +00:00
Explicitly link against libatomic on Linux/sparc for __atomic_fetch_add_4
On this platform atomic instructions are implemented using `libatomic` so we need to link it to use them.
This commit is contained in:
parent
4918cd8c98
commit
cda9a904b5
@ -785,6 +785,15 @@ target_link_libraries(CMakeLib cmsys
|
||||
${CMake_KWIML_LIBRARIES}
|
||||
)
|
||||
|
||||
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 atomic)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# On Apple we need CoreFoundation
|
||||
if(APPLE)
|
||||
target_link_libraries(CMakeLib "-framework CoreFoundation")
|
||||
|
Loading…
Reference in New Issue
Block a user