diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index afe4fbb..621fc80 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -22,10 +22,12 @@ target_link_libraries(${PROJECT_NAME}-tests-17 PRIVATE Catch2::Catch2WithMain ${ catch_discover_tests(${PROJECT_NAME}-tests-17) # add c++20 tests +add_executable(${PROJECT_NAME}-tests-20 ${TEST_SRC}) if(SEMVER_BUILD_MODULE) - list(APPEND TEST_SRC module/module_tests.cpp) + target_sources(${PROJECT_NAME}-tests-20 PRIVATE module/module_tests.cpp) + set_target_properties(${PROJECT_NAME}-tests-20 PROPERTIES CXX_SCAN_FOR_MODULES ON) + set_target_properties(${PROJECT_NAME}-tests-20 PROPERTIES CXX_EXTENSIONS OFF) endif() -add_executable(${PROJECT_NAME}-tests-20 ${TEST_SRC}) set_target_properties(${PROJECT_NAME}-tests-20 PROPERTIES CXX_STANDARD 20) target_link_libraries(${PROJECT_NAME}-tests-20 PRIVATE Catch2::Catch2WithMain ${PROJECT_NAME}) catch_discover_tests(${PROJECT_NAME}-tests-20) \ No newline at end of file