From 144b4a2d3e1535634b5e8a5d12fa9e64e44dadbd Mon Sep 17 00:00:00 2001 From: daan Date: Wed, 15 Dec 2021 08:42:58 -0800 Subject: [PATCH] link with libatomic automatically if found --- CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 48ecd315..6b2e9b83 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -218,10 +218,10 @@ else() if(MI_LIBRT) list(APPEND mi_libraries ${MI_LIBRT}) endif() -endif() - -if (MI_USE_LIBATOMIC) - list(APPEND mi_libraries atomic) + find_library(MI_LIBATOMIC atomic) + if (MI_LIBATOMIC OR MI_USE_LIBATOMIC) + list(APPEND mi_libraries atomic) + endif() endif() # -----------------------------------------------------------------------------