From a499b2d5801f302f6980f474488e5330d276fcf5 Mon Sep 17 00:00:00 2001 From: Masaki Waga Date: Tue, 9 Jan 2024 17:52:57 +0900 Subject: [PATCH] Add the include directory provided by Homebrew if the platform is macOS on ARM64 --- CMakeLists.txt | 4 ++++ thirdparties/spqliox_aarch64/CMakeLists.txt | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7fa54b5..2e8ca93 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -78,6 +78,10 @@ if(USE_FFTW3) elseif(USE_SPQLIOX_AARCH64) add_compile_definitions(USE_SPQLIOX_AARCH64) add_subdirectory(thirdparties/spqliox_aarch64) + # Check if the platform is macOS and the architecture is ARM64 + if(APPLE AND CMAKE_SYSTEM_PROCESSOR MATCHES "arm64") + include_directories(/opt/homebrew/include) + endif() else() add_subdirectory(thirdparties/spqlios) endif() diff --git a/thirdparties/spqliox_aarch64/CMakeLists.txt b/thirdparties/spqliox_aarch64/CMakeLists.txt index 0f12a99..d2a28ed 100644 --- a/thirdparties/spqliox_aarch64/CMakeLists.txt +++ b/thirdparties/spqliox_aarch64/CMakeLists.txt @@ -5,4 +5,10 @@ set(SPQLIOX_AARCH64_HEADERS fft_processor_spqliox_aarch64.h add_library(spqliox_aarch64 STATIC ${SPQLIOX_AARCH64_SRCS} ${SPQLIOX_AARCH64_HEADERS}) -target_include_directories(spqliox_aarch64 PUBLIC ${PROJECT_SOURCE_DIR}/include) +# Check if the platform is macOS and the architecture is ARM64 +if(APPLE AND CMAKE_SYSTEM_PROCESSOR MATCHES "arm64") + # Add the include directory provided by Homebrew + target_include_directories(spqliox_aarch64 PUBLIC ${PROJECT_SOURCE_DIR}/include /opt/homebrew/include) +else() + target_include_directories(spqliox_aarch64 PUBLIC ${PROJECT_SOURCE_DIR}/include) +endif()