Skip to content

Commit

Permalink
Merge pull request #48 from MasWag/master
Browse files Browse the repository at this point in the history
Add Homebrew Includes for ARM64 macOS in CMake
  • Loading branch information
nindanaoto authored Mar 5, 2024
2 parents f764ea5 + a499b2d commit 4aa32d2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
8 changes: 7 additions & 1 deletion thirdparties/spqliox_aarch64/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit 4aa32d2

Please sign in to comment.