We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
-latomic
1 parent 35baa71 commit 9486cb5Copy full SHA for 9486cb5
scripts/CMakeLists.txt
@@ -54,8 +54,10 @@ foreach (STD IN LISTS CXX_STANDARDS)
54
add_test(NAME ${TGT} COMMAND ${TGT})
55
set_target_properties_for_fork_union_script(${TGT})
56
57
- # Link against libatomic for older GCC versions that might need it
58
- if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
+ # Link against `libatomic` for older GCC versions that might need it
+ # Note: AppleClang doesn't need `libatomic` as atomic operations are built-in
59
+ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR
60
+ (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang"))
61
target_link_libraries(${TGT} PRIVATE -latomic)
62
endif ()
63
0 commit comments