diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 64c462694..79436dd68 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -57,9 +57,9 @@ jobs: run: | cmake \ -D CMAKE_BUILD_TYPE=${{ matrix.build_mode }} \ - -D mimicpp_BUILD_TESTS=yes \ -D CMAKE_VERBOSE_MAKEFILE=yes \ - -D CMAKE_CXX_STANDARD=${{ matrix.config.cxx_standard }} \ + -D mimicpp_BUILD_TESTS=yes \ + -D mimicpp_FORCED_CXX_STANDARD=${{ matrix.config.cxx_standard }} -B build -S . cmake --build build -j4 diff --git a/CMakeLists.txt b/CMakeLists.txt index 8de67e8e4..fc250fef7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,6 +29,10 @@ else() set(IS_TOP_LEVEL_PROJECT OFF) endif() +if (mimicpp_FORCED_CXX_STANDARD) + set(CMAKE_CXX_STANDARD ${mimicpp_FORCED_CXX_STANDARD}) +endif() + OPTION(mimicpp_BUILD_TESTS "Determines whether tests shall be built." ${IS_TOP_LEVEL_PROJECT}) if (mimicpp_BUILD_TESTS) include(CTest) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 4656e17f6..2dde155a5 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -23,4 +23,10 @@ target_link_libraries( trompeloeil::trompeloeil ) +target_compile_features( + mimicpp + INTERFACE + cxx_std_${CMAKE_CXX_STANDARD} +) + catch_discover_tests(mimicpp-tests)