Add CMake flag to treat warnings as errors

pull/1436/head
Turo Lamminen 2017-09-14 10:54:02 +03:00
parent dce39fdf43
commit f2e2f74d73
1 changed files with 9 additions and 0 deletions

View File

@ -78,6 +78,10 @@ OPTION ( ASSIMP_COVERALLS
"Enable this to measure test coverage."
OFF
)
OPTION ( ASSIMP_WERRRO
"Treat warnings as errors."
OFF
)
OPTION ( SYSTEM_IRRXML
"Use system installed Irrlicht/IrrXML library."
OFF
@ -212,6 +216,11 @@ if (ASSIMP_COVERALLS)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage")
endif()
if (ASSIMP_WERROR)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
endif()
INCLUDE (FindPkgMacros)
INCLUDE (PrecompiledHeader)