diff --git a/CMakeLists.txt b/CMakeLists.txt index bee64ba..9f0c3ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,5 @@ cmake_minimum_required(VERSION 3.20) project(chowdsp_fft) -set(CMAKE_CXX_STANDARD 20) add_library(chowdsp_fft STATIC) target_sources(chowdsp_fft @@ -10,6 +9,7 @@ target_sources(chowdsp_fft ) target_include_directories(chowdsp_fft PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_compile_definitions(chowdsp_fft PRIVATE _USE_MATH_DEFINES=1) +target_compile_features(chowdsp_fft PRIVATE cxx_std_17) include(CheckCXXCompilerFlag) CHECK_CXX_COMPILER_FLAG("/arch:AVX2" COMPILER_OPT_ARCH_AVX_MSVC_SUPPORTED) @@ -19,6 +19,7 @@ if(COMPILER_OPT_ARCH_AVX_MSVC_SUPPORTED) add_library(chowdsp_fft_avx STATIC simd/chowdsp_fft_impl_avx.cpp) target_compile_options(chowdsp_fft_avx PRIVATE /arch:AVX2) target_compile_definitions(chowdsp_fft_avx PRIVATE _USE_MATH_DEFINES=1) + target_compile_features(chowdsp_fft_avx PRIVATE cxx_std_17) target_link_libraries(chowdsp_fft PRIVATE chowdsp_fft_avx) target_compile_definitions(chowdsp_fft PRIVATE CHOWDSP_FFT_COMPILER_SUPPORTS_AVX=1) else() @@ -26,6 +27,7 @@ else() message(STATUS "chowdsp_fft -- Compiler supports flags: -mavx2 -mfma") add_library(chowdsp_fft_avx STATIC simd/chowdsp_fft_impl_avx.cpp) target_compile_options(chowdsp_fft_avx PRIVATE -mavx2 -mfma -Wno-unused-command-line-argument) + target_compile_features(chowdsp_fft_avx PRIVATE cxx_std_17) target_compile_definitions(chowdsp_fft_avx PRIVATE _USE_MATH_DEFINES=1) target_link_libraries(chowdsp_fft PRIVATE chowdsp_fft_avx) target_compile_definitions(chowdsp_fft PRIVATE CHOWDSP_FFT_COMPILER_SUPPORTS_AVX=1) diff --git a/bench/CMakeLists.txt b/bench/CMakeLists.txt index 91a738a..e87591e 100644 --- a/bench/CMakeLists.txt +++ b/bench/CMakeLists.txt @@ -4,3 +4,4 @@ add_executable(bench_chowdsp_fft bench.cpp) target_link_libraries(bench_chowdsp_fft PRIVATE chowdsp_fft) target_include_directories(bench_chowdsp_fft PRIVATE ${CMAKE_BINARY_DIR}/_deps/pffft-src) target_compile_definitions(bench_chowdsp_fft PRIVATE _USE_MATH_DEFINES=1) +target_compile_features(bench_chowdsp_fft PRIVATE cxx_std_20) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 245f1ef..9a510ed 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -9,6 +9,7 @@ add_executable(test_chowdsp_fft_cpp test.cpp ${pffft_SOURCE_DIR}/pffft.c) target_link_libraries(test_chowdsp_fft_cpp PRIVATE chowdsp_fft Catch2::Catch2WithMain) target_include_directories(test_chowdsp_fft_cpp PRIVATE ${pffft_SOURCE_DIR}) target_compile_definitions(test_chowdsp_fft_cpp PRIVATE _USE_MATH_DEFINES=1) +target_compile_features(test_chowdsp_fft_cpp PRIVATE cxx_std_20) if(CHOWDSP_FFT_COVERAGE) message(STATUS "chowdsp_fft -- Appending code coverage compiler flags: -g --coverage")