Bladeren bron

Optional warnings added. These are only used if supported by the

compiler.
main
offa 7 jaren geleden
bovenliggende
commit
9ec6531861
2 gewijzigde bestanden met toevoegingen van 20 en 0 verwijderingen
  1. +7
    -0
      CMakeLists.txt
  2. +13
    -0
      cmake/Compiler.cmake

+ 7
- 0
CMakeLists.txt Bestand weergeven

@@ -15,6 +15,7 @@ else()
message(STATUS "Build Type : None")
endif()

include(Compiler)

if( COVERAGE )
include(Coverage)
@@ -28,6 +29,12 @@ add_compile_options(-Wall
-Wshadow
-Wold-style-cast
)
add_compile_options_if_supported(-Wduplicated-cond
-Wduplicated-branches
-Wlogical-op
-Wnull-dereference
-Wuseless-cast
)


set(CMAKE_CXX_STANDARD 14)

+ 13
- 0
cmake/Compiler.cmake Bestand weergeven

@@ -0,0 +1,13 @@
include(CheckCXXCompilerFlag)

function(add_compile_options_if_supported)
foreach(flag ${ARGN})
set(option_var option_supported_${flag})
CHECK_CXX_COMPILER_FLAG(${flag} ${option_var})

if( ${option_var} )
add_compile_options(${flag})
endif()
endforeach()
endfunction()


Laden…
Annuleren
Opslaan