1
0
Fork 0
mirror of https://github.com/TheLartians/ModernCppStarter.git synced 2025-09-03 23:50:53 +02:00

final cleanup

add some notes to not install tcov od test builds
This commit is contained in:
ClausKlein 2021-02-07 01:10:24 +01:00
parent 3c55643690
commit a6a16d64f3
2 changed files with 11 additions and 8 deletions

View file

@ -44,6 +44,7 @@ target_compile_features(GreeterTests PUBLIC cxx_std_17)
# enable compiler warnings
if(NOT TEST_INSTALLED_VERSION)
# NOTE: with this options the target should not installed! CK
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
target_compile_options(Greeter PRIVATE -Wall -Wpedantic -Wextra -Werror)
elseif(MSVC)
@ -65,7 +66,8 @@ add_test(NAME GreeterTests COMMAND GreeterTests --success=false)
# ---- code coverage ----
# NOTE: with this options the target should not installed! CK
if(ENABLE_TEST_COVERAGE AND NOT TEST_INSTALLED_VERSION)
target_compile_options(Greeter PRIVATE -O0 -g -fprofile-arcs -ftest-coverage)
target_link_options(Greeter PRIVATE -fprofile-arcs -ftest-coverage)
target_compile_options(Greeter PUBLIC -O0 -g -fprofile-arcs -ftest-coverage)
target_link_options(Greeter PUBLIC -fprofile-arcs -ftest-coverage)
endif()