From 392c3ed42674a0a02a10ec3bdf229f9f7f9d3021 Mon Sep 17 00:00:00 2001 From: Roland Schwan Date: Thu, 3 Aug 2023 21:07:11 +0200 Subject: [PATCH] set TARGET_OS_OSX=1 for macOS conda-forge builds --- CMakeLists.txt | 5 +++++ interfaces/python/src/instruction_set.cpp | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index df8bded..6b2414a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,6 +59,11 @@ if (ENABLE_SANITIZERS) endif () if (BUILD_PYTHON_INTERFACE OR BUILD_MATLAB_INTERFACE) + # building for conda-forge, TARGET_OS_OSX is not properly set, i.e., macOS is not correctly detected + if (DEFINED ENV{CONDA_TOOLCHAIN_BUILD} AND APPLE) + add_definitions(-DTARGET_OS_OSX=1) + endif () + # Find cpu_features include(FetchContent) FetchContent_Declare( diff --git a/interfaces/python/src/instruction_set.cpp b/interfaces/python/src/instruction_set.cpp index 7f87286..988e1e4 100644 --- a/interfaces/python/src/instruction_set.cpp +++ b/interfaces/python/src/instruction_set.cpp @@ -8,11 +8,6 @@ #include -// building for conda-forge, TARGET_OS_OSX is not properly set, i.e., macOS is not correctly detected -#if defined(TARGET_OS_MAC) -#define TARGET_OS_OSX 1 -#endif - #if defined(CPU_FEATURES_AVAILABLE) #include "cpu_features_macros.h" #endif