CMake: Use CMAKE_COMPILE_WARNING_AS_ERROR
This commit is contained in:
@@ -74,14 +74,15 @@ else()
|
|||||||
$<$<COMPILE_LANGUAGE:CXX>:-Woverloaded-virtual>
|
$<$<COMPILE_LANGUAGE:CXX>:-Woverloaded-virtual>
|
||||||
$<$<COMPILE_LANGUAGE:CXX>:-Wold-style-cast>
|
$<$<COMPILE_LANGUAGE:CXX>:-Wold-style-cast>
|
||||||
)
|
)
|
||||||
option(BUILD_WERROR "Build with -Werror" ON)
|
|
||||||
if(BUILD_WERROR)
|
|
||||||
list(APPEND COMPILE_OPTIONS -Werror)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_compile_options(${COMPILE_OPTIONS})
|
add_compile_options(${COMPILE_OPTIONS})
|
||||||
|
|
||||||
|
option(BUILD_WERROR "Build with -Werror" OFF)
|
||||||
|
if(BUILD_WERROR)
|
||||||
|
set(CMAKE_COMPILE_WARNING_AS_ERROR ON)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(CMAKE_BUILD_TYPE MATCHES "Release")
|
if(CMAKE_BUILD_TYPE MATCHES "Release")
|
||||||
add_definitions(-DNDEBUG)
|
add_definitions(-DNDEBUG)
|
||||||
set(ENABLE_DEBUG_OUTPUT_DEFAULT OFF)
|
set(ENABLE_DEBUG_OUTPUT_DEFAULT OFF)
|
||||||
|
|||||||
Reference in New Issue
Block a user