@@ -217,9 +217,11 @@ if (CLANG)
217217else ()
218218 option (KFR_ENABLE_DFT "Enable DFT and related algorithms." OFF )
219219endif ()
220- option (KFR_ENABLE_ASMTEST "Enable writing disassembly" OFF )
221220option (KFR_ENABLE_AUDIO "Enable Audio classes" ON )
222221option (KFR_ENABLE_IO "Enable IO classes" ON )
222+ option (KFR_ENABLE_DSP "Enable DSP module" ON )
223+
224+ option (KFR_ENABLE_ASMTEST "Enable writing disassembly" OFF )
223225option (KFR_REGENERATE_TESTS "Regenerate auto tests" OFF )
224226option (KFR_DISABLE_CLANG_EXTENSIONS "Disable Clang vector extensions" OFF )
225227option (KFR_EXTENDED_TESTS "Extended tests (up to hour)" OFF )
@@ -425,9 +427,24 @@ if (MSVC)
425427 target_compile_options (kfr INTERFACE $<$<CXX_COMPILER_ID :MSVC >:/Zc :lambda >)
426428endif ()
427429
428- if (NOT KFR_ENABLE_DFT)
430+ if (KFR_ENABLE_DFT)
431+ target_compile_definitions (kfr INTERFACE $<BUILD_INTERFACE :KFR_HAVE_DFT >)
432+ else ()
429433 target_compile_definitions (kfr INTERFACE $<BUILD_INTERFACE :KFR_NO_DFT >)
430434endif ()
435+
436+ if (KFR_ENABLE_DSP)
437+ target_compile_definitions (kfr INTERFACE $<BUILD_INTERFACE :KFR_HAVE_DSP >)
438+ endif ()
439+
440+ if (KFR_ENABLE_IO)
441+ target_compile_definitions (kfr INTERFACE $<BUILD_INTERFACE :KFR_HAVE_IO >)
442+ endif ()
443+
444+ if (KFR_ENABLE_AUDIO)
445+ target_compile_definitions (kfr INTERFACE $<BUILD_INTERFACE :KFR_HAVE_AUDIO >)
446+ endif ()
447+
431448if (KFR_EXTENDED_TESTS)
432449 target_compile_definitions (kfr
433450 INTERFACE $<BUILD_INTERFACE :KFR_EXTENDED_TESTS >)
@@ -442,13 +459,23 @@ set(KFR_DEBUG_INSTALL_SUFFIX
442459 "/debug"
443460 CACHE STRING "" )
444461
445- add_subdirectory (src/dsp )
446- if (KFR_ENABLE_IO)
447- add_subdirectory (src/io )
448- if (KFR_ENABLE_AUDIO)
462+ if (KFR_ENABLE_AUDIO AND NOT KFR_ENABLE_IO)
463+ message (FATAL_ERROR "KFR_ENABLE_AUDIO requires KFR_ENABLE_IO to be enabled" )
464+ endif ()
465+ if (KFR_ENABLE_AUDIO AND NOT KFR_ENABLE_DSP)
466+ message (
467+ FATAL_ERROR "KFR_ENABLE_AUDIO requires KFR_ENABLE_DSP to be enabled" )
468+ endif ()
469+
470+ if (KFR_ENABLE_DSP)
471+ add_subdirectory (src/dsp )
472+ endif ()
473+ if (KFR_ENABLE_IO)
474+ add_subdirectory (src/io )
475+ endif ()
476+ if (KFR_ENABLE_AUDIO)
449477 add_subdirectory (src/audio )
450- endif ()
451- endif ()
478+ endif ()
452479if (KFR_ENABLE_DFT)
453480 add_subdirectory (src/dft )
454481endif ()
@@ -481,14 +508,15 @@ if (KFR_ENABLE_DFT)
481508 append_defines_from (kfr_dft )
482509endif ()
483510
484- append_defines_from (kfr_dsp )
485-
486- if (KFR_ENABLE_IO)
487- append_defines_from (kfr_io )
488- if (KFR_ENABLE_AUDIO)
511+ if (KFR_ENABLE_DSP)
512+ append_defines_from (kfr_dsp )
513+ endif ()
514+ if (KFR_ENABLE_IO)
515+ append_defines_from (kfr_io )
516+ endif ()
517+ if (KFR_ENABLE_AUDIO)
489518 append_defines_from (kfr_audio )
490- endif ()
491- endif ()
519+ endif ()
492520
493521string (REPLACE "$<BUILD_INTERFACE :" "" kfr_defines "${kfr_defines} ")
494522string (REPLACE ">" "" kfr_defines "${kfr_defines} " )
0 commit comments