From eae9e7251afd5e4fd578c623fa1b9cf7053bdaab Mon Sep 17 00:00:00 2001 From: Peter Csajtai Date: Sun, 28 Jul 2024 00:35:44 +0200 Subject: [PATCH] Update CMakeLists.txt --- test/CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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