From 62d87ab4334f28f948b9e4f835a0018dd8383a48 Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 21 Feb 2024 18:40:53 +0300 Subject: [PATCH] Link atomic with target_link_libraries. --- CMakeLists.txt | 5 ----- tdutils/CMakeLists.txt | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d17ede50a..c2daf8273 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -132,11 +132,6 @@ endif() include(TdSetUpCompiler) td_set_up_compiler() -find_package(Atomics REQUIRED) -if (ATOMICS_LIBRARIES) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ATOMICS_LIBRARIES}") -endif() - if (MSVC) option(TD_ENABLE_MULTI_PROCESSOR_COMPILATION "Use \"ON\" to enable multi-processor compilation.") diff --git a/tdutils/CMakeLists.txt b/tdutils/CMakeLists.txt index 790db368e..1240682fc 100644 --- a/tdutils/CMakeLists.txt +++ b/tdutils/CMakeLists.txt @@ -403,6 +403,11 @@ if (ANDROID) target_link_libraries(tdutils PRIVATE log) endif() +find_package(Atomics REQUIRED) +if (ATOMICS_LIBRARIES) + target_link_libraries(tdutils PUBLIC "${ATOMICS_LIBRARIES}") +endif() + install(TARGETS tdutils EXPORT TdStaticTargets LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"