Skip to content

Commit 94d677b

Browse files
committed
Add SIGNALSMITH_USE_... CMake options
1 parent c6167a2 commit 94d677b

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

CMakeLists.txt

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,24 @@ endif()
3030
## target_compile_definitions(fft2 INTERFACE SIGNALSMITH_USE_CBLAS)
3131
#endif()
3232

33-
if(WIN32)
34-
find_package(IPP)
33+
option(SIGNALSMITH_USE_AVAILABLE "use whatever useful dependencies (e.g. IPP) can be found" ON)
34+
option(SIGNALSMITH_USE_ACCELERATE "always use the Accelerate framework for Apple targets (OSX/iOS)" ON)
35+
option(SIGNALSMITH_USE_IPP "always use IPP (Intel Performance Primitives)" OFF)
36+
37+
if(SIGNALSMITH_USE_AVAILABLE)
38+
find_package(IPP QUIET)
3539
if(IPP_FOUND)
36-
message(STATUS "using IPP")
37-
target_link_libraries(signalsmith-linear INTERFACE IPP::ippcore IPP::ipps IPP::ippi)
38-
target_compile_definitions(signalsmith-linear INTERFACE SIGNALSMITH_USE_IPP)
40+
set(SIGNALSMITH_USE_IPP BOOLEAN ON)
3941
endif()
40-
elseif(APPLE)
41-
#find_library(Accelerate_LIBRARY NAMES Accelerate)
42+
endif()
43+
44+
if(APPLE AND SIGNALSMITH_USE_ACCELERATE)
4245
message(STATUS "using Accelerate")
4346
target_link_libraries(signalsmith-linear INTERFACE "-framework Accelerate" "cblas")
4447
target_compile_definitions(signalsmith-linear INTERFACE SIGNALSMITH_USE_ACCELERATE ACCELERATE_NEW_LAPACK)
45-
endif()
48+
elseif(SIGNALSMITH_USE_IPP)
49+
find_package(IPP REQUIRED)
50+
message(STATUS "using IPP")
51+
target_link_libraries(signalsmith-linear INTERFACE IPP::ippcore IPP::ipps IPP::ippi)
52+
target_compile_definitions(signalsmith-linear INTERFACE SIGNALSMITH_USE_IPP)
53+
endif()

tests/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ FetchContent_MakeAvailable(signalsmith_dsp)
2424
FetchContent_Declare(
2525
signalsmith_plot
2626
GIT_REPOSITORY https://github.com/Signalsmith-Audio/plot.git
27-
GIT_TAG e53eb933ae0de8bb8acd54b3e96a8bed6a708a2a # main
27+
GIT_TAG 1.0.0
2828
GIT_SHALLOW ON
2929
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/plot"
3030
)

0 commit comments

Comments
 (0)