1
0
Fork 0
mirror of https://github.com/TheLartians/ModernCppStarter.git synced 2025-08-30 21:51:12 +02:00

why manipulate target properies?

disable ccache be default
but use -Wpendatic instead of -pedeantic
This commit is contained in:
ClausKlein 2021-02-06 23:37:28 +01:00
parent 48ab4e707d
commit 0ec4474d42
4 changed files with 5 additions and 4 deletions

View file

@ -41,7 +41,7 @@ CPMAddPackage(
# NOTE: If fmt is not imported, this is needed to prevent:
# CMake Error: install(EXPORT "GreeterTargets" ...) includes target
# "Greeter" which requires target "fmt" that is not in any export set.
option(FMT_INSTALL "" YES)
option(FMT_INSTALL "needed!" YES)
CPMAddPackage(
NAME fmt

View file

@ -67,7 +67,7 @@ if(USE_SANITIZER OR USE_STATIC_ANALYZER)
endif()
# enables CCACHE support through the USE_CCACHE flag possible values are: YES, NO or equivalent
option(USE_CCACHE "enable ccache usages" ON)
option(USE_CCACHE "enable ccache usages" NO)
if(USE_CCACHE)
CPMAddPackage(
NAME Ccache.cmake

View file

@ -26,7 +26,8 @@ file(GLOB sources CONFIGURE_DEPENDS source/*.cpp)
add_executable(GreeterStandalone ${sources})
# FIXME: WHY? CK
# set_target_properties(GreeterStandalone PROPERTIES CXX_STANDARD 17 OUTPUT_NAME "Greeter")
set_target_properties(GreeterStandalone OUTPUT_NAME "Greeter")
target_compile_features(GreeterStandalone PUBLIC cxx_std_17)
target_link_libraries(GreeterStandalone PRIVATE Greeter::Greeter cxxopts)

View file

@ -45,7 +45,7 @@ target_compile_features(GreeterTests PUBLIC cxx_std_17)
# enable compiler warnings
if(NOT TEST_INSTALLED_VERSION)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
target_compile_options(Greeter PRIVATE -Wall -pedantic -Wextra -Werror)
target_compile_options(Greeter PRIVATE -Wall -Wpedantic -Wextra -Werror)
elseif(MSVC)
target_compile_options(Greeter PRIVATE /W4 /WX)
target_compile_definitions(GreeterTests PRIVATE DOCTEST_CONFIG_USE_STD_HEADERS)