Add development build option to CMake and enable it on CI

Development build enables warnings and and `Werror` or equivalent.
This commit is contained in:
Martin Hořeňovský
2020-02-21 21:15:45 +01:00
parent 50b2cfa5de
commit 6e270958a2
8 changed files with 124 additions and 48 deletions

View File

@@ -56,17 +56,8 @@ foreach( name ${ALL_EXAMPLE_TARGETS} )
target_link_libraries( ${name} Catch2 )
set_property(TARGET ${name} PROPERTY CXX_STANDARD 14)
set_property(TARGET ${name} PROPERTY CXX_EXTENSIONS OFF)
# Add desired warnings
if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang|AppleClang|GNU" )
target_compile_options( ${name} PRIVATE -Wall -Wextra -Wunreachable-code )
endif()
# Clang specific warning go here
if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
# Actually keep these
target_compile_options( ${name} PRIVATE -Wweak-vtables -Wexit-time-destructors -Wglobal-constructors -Wmissing-noreturn )
endif()
if ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
target_compile_options( ${name} PRIVATE /W4 /w44265 /WX )
endif()
endforeach()
list(APPEND CATCH_WARNING_TARGETS ${ALL_EXAMPLE_TARGETS})
set(CATCH_WARNING_TARGETS ${CATCH_WARNING_TARGETS} PARENT_SCOPE)