瀏覽代碼

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

compiler.
main
offa 8 年之前
父節點
當前提交
9ec6531861
共有 2 個檔案被更改,包括 20 行新增0 行删除
  1. +7
    -0
      CMakeLists.txt
  2. +13
    -0
      cmake/Compiler.cmake

+ 7
- 0
CMakeLists.txt 查看文件

message(STATUS "Build Type : None") message(STATUS "Build Type : None")
endif() endif()


include(Compiler)


if( COVERAGE ) if( COVERAGE )
include(Coverage) include(Coverage)
-Wshadow -Wshadow
-Wold-style-cast -Wold-style-cast
) )
add_compile_options_if_supported(-Wduplicated-cond
-Wduplicated-branches
-Wlogical-op
-Wnull-dereference
-Wuseless-cast
)




set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD 14)

+ 13
- 0
cmake/Compiler.cmake 查看文件

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()


Loading…
取消
儲存