From b6c7c5a7abc9a4df544bfc309c3800fe4942c768 Mon Sep 17 00:00:00 2001 From: Desour Date: Sat, 22 Apr 2023 18:42:08 +0200 Subject: [PATCH] Link with -latomic --- src/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2e0fdc7c1a3f..082158c6ee57 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -314,6 +314,13 @@ else() endif() endif() +# On clang and gcc, some functionalities of std::atomic require -latomic. +# See . +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(