Commit 2ad40520 authored by Brad King's avatar Brad King Committed by Kitware Robot

Merge topic 'sparc-libatomic'

cda9a904 Explicitly link against libatomic on Linux/sparc for `__atomic_fetch_add_4`
parents 7bd1d535 cda9a904
......@@ -787,6 +787,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")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment