From aa5e6400e42e18014a7cfb7927554253610582d0 Mon Sep 17 00:00:00 2001 From: barracuda156 Date: Sat, 26 Nov 2022 06:35:28 +0800 Subject: [PATCH] CMakeLists: use a fix for atomics on macOS PPC, not PPC in general --- build/CMakeLists.txt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/build/CMakeLists.txt b/build/CMakeLists.txt index 7f7cb4c8..d9c50e9c 100644 --- a/build/CMakeLists.txt +++ b/build/CMakeLists.txt @@ -176,14 +176,12 @@ if(WITH_THREADSANITIZER) endif() endif() - -# Enable usage of STD's Atomic instead of Boost's on PowerPC -# For more information refer to https://github.com/PurpleI2P/i2pd/issues/1726#issuecomment-1306335111 -if(ARCHITECTURE MATCHES "ppc") +# Use std::atomic instead of GCC builtins on macOS PowerPC: +# For more information refer to: https://github.com/PurpleI2P/i2pd/issues/1726#issuecomment-1306335111 +if(APPLE AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc") add_definitions(-DBOOST_SP_USE_STD_ATOMIC) endif() - # libraries set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED)