mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
cmake: add -Wall -Werror
This commit is contained in:
parent
7dc1d0cb50
commit
e4e3fba878
1 changed files with 26 additions and 0 deletions
|
@ -31,6 +31,32 @@ set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH ON)
|
|||
find_package(PkgConfig)
|
||||
include(CheckIncludeFile)
|
||||
include(FeatureSummary)
|
||||
include(CheckCCompilerFlag)
|
||||
#include(CheckCxxCompilerFlag)
|
||||
|
||||
if(MSVC)
|
||||
check_c_compiler_flag("/W4 /WX" C_SUPPORTS_WERROR)
|
||||
# check_cxx_compiler_flag("/W4 /WX" CXX_SUPPORTS_WERROR)
|
||||
|
||||
if(C_SUPPORTS_WERROR)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4 /WX")
|
||||
endif()
|
||||
|
||||
if(CXX_SUPPORTS_WERROR)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /WX")
|
||||
endif()
|
||||
else()
|
||||
check_c_compiler_flag("-Wall -Werror" C_SUPPORTS_WERROR)
|
||||
# check_cxx_compiler_flag("-Wall -Werror" CXX_SUPPORTS_WERROR)
|
||||
|
||||
if(C_SUPPORTS_WERROR)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror")
|
||||
endif()
|
||||
|
||||
if(CXX_SUPPORTS_WERROR)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Check OS
|
||||
check_include_file("sys/eventfd.h" HAS_EVENTFD)
|
||||
|
|
Loading…
Add table
Reference in a new issue