1
0
Fork 0
mirror of https://github.com/TheLartians/ModernCppStarter.git synced 2025-09-06 00:41:01 +02:00

use WarningsAsErrors by default while build

This commit is contained in:
ClausKlein 2021-03-04 17:59:31 +01:00
parent f222eb3ce1
commit 46d2235289
6 changed files with 20 additions and 8 deletions

View file

@ -26,7 +26,6 @@ include(cmake/options.cmake)
# see https://github.com/cpm-cmake/CPM.cmake for more info
include(cmake/CPM.cmake)
CPMUsePackageLock(package-lock.cmake)
# PackageProject.cmake will be used to make our target installable
CPMAddPackage("gh:TheLartians/PackageProject.cmake@1.4.1")
@ -61,6 +60,11 @@ set_target_properties(
CMAKE_VISIBILITY_INLINES_HIDDEN ${BUILD_SHARED_LIBS}
)
option(WarningsAsErrors "Be realy pedantic!" YES)
if(WarningsAsErrors)
include(${CMAKE_CURRENT_LIST_DIR}/cmake/WarningsAsErrors.cmake)
endif()
# being a cross-platform target, we enforce standards conformance on MSVC
target_compile_options(Greeter PUBLIC $<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/permissive>)