Link with -latomic

This commit is contained in:
Desour 2023-04-22 18:42:08 +02:00 committed by sfan5
parent 46c930cf70
commit b6c7c5a7ab
1 changed files with 7 additions and 0 deletions

View File

@ -314,6 +314,13 @@ else()
endif()
endif()
# On clang and gcc, some functionalities of std::atomic require -latomic.
# See <https://en.cppreference.com/w/cpp/atomic/atomic#Notes>.
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang"
OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(PLATFORM_LIBS ${PLATFORM_LIBS} atomic)
endif()
check_include_files(endian.h HAVE_ENDIAN_H)
configure_file(