From 14c708a57144a0aaf99af0852e7f1260ad3169f6 Mon Sep 17 00:00:00 2001 From: CastagnaIT Date: Fri, 4 Oct 2024 08:48:40 +0200 Subject: [PATCH] [cmakelists] Fix atomic target link to linux --- CMakeLists.txt | 4 ++++ src/test/CMakeLists.txt | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ff1f2ba8a..69daa323d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,6 +34,10 @@ else() add_definitions(-D__STDC_FORMAT_MACROS) endif() +if(${CMAKE_SYSTEM_NAME} STREQUAL Linux) + list(APPEND DEPLIBS "atomic") +endif() + # Sources to build # (use add_dir_sources function to add source/header files from the CMakeLists files of subdirectories) add_subdirectory(src) diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt index 9c163249e..f16e0455a 100644 --- a/src/test/CMakeLists.txt +++ b/src/test/CMakeLists.txt @@ -53,7 +53,7 @@ add_executable(${BINARY} ../utils/XMLUtils.cpp ) -if(LINUX) +if(${CMAKE_SYSTEM_NAME} STREQUAL Linux) SET(ADD_LINK_LIBS "atomic") endif()