Commit b9e1cde4 authored by Marcus D. Hanwell's avatar Marcus D. Hanwell

ENH: Added an option to turn on extra warnings.

Added the option to turn on stricter compiler flags (GCC only right
now), default to off. The flags are quite safe in VTK, but can cause
hundreds of warnings in some other projects code bases.
parent 7fb95fa9
......@@ -45,10 +45,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
set(VTK_ABI_CXX_FLAGS "")
endif()
# Set up the release with debug info and debug CXX_FLAGS for extra warnings
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO
"${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${CMAKE_CXX_FLAGS_WARN}")
set(CMAKE_CXX_FLAGS_DEBUG
"${CMAKE_CXX_FLAGS_DEBUG} ${CMAKE_CXX_FLAGS_WARN} ${CMAKE_CXX_FLAGS_ERROR}")
# Set up the debug CXX_FLAGS for extra warnings
option(VTK_EXTRA_COMPILER_WARNINGS
"Add compiler flags to do stricter checking when building debug." OFF)
if(VTK_EXTRA_COMPILER_WARNINGS)
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO
"${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${CMAKE_CXX_FLAGS_WARN}")
set(CMAKE_CXX_FLAGS_DEBUG
"${CMAKE_CXX_FLAGS_DEBUG} ${CMAKE_CXX_FLAGS_WARN} ${CMAKE_CXX_FLAGS_ERROR}")
endif()
endif()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment