mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#6018 Add RESINSIGHT_TREAT_WARNINGS_AS_ERRORS build flag.
The flag controls "-Werror" on linux. Default is off.
This commit is contained in:
@@ -22,6 +22,7 @@ find_package( OpenGL )
|
|||||||
|
|
||||||
option(RESINSIGHT_ENABLE_GRPC "Enable the gRPC scripting framework" OFF)
|
option(RESINSIGHT_ENABLE_GRPC "Enable the gRPC scripting framework" OFF)
|
||||||
option(RESINSIGHT_GRPC_BUNDLE_PYTHON_MODULE "Bundle the gRPC python modules into the install folder" OFF)
|
option(RESINSIGHT_GRPC_BUNDLE_PYTHON_MODULE "Bundle the gRPC python modules into the install folder" OFF)
|
||||||
|
option(RESINSIGHT_TREAT_WARNINGS_AS_ERRORS "Treat warnings as errors (stops build)" OFF)
|
||||||
|
|
||||||
find_package(Qt5 COMPONENTS Core QUIET)
|
find_package(Qt5 COMPONENTS Core QUIET)
|
||||||
|
|
||||||
@@ -393,7 +394,7 @@ endif()
|
|||||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||||
set_target_properties(ResInsight PROPERTIES COMPILE_FLAGS "-Wall -Wno-unused-parameter -Wno-reorder -Wno-parentheses -Wno-switch")
|
set_target_properties(ResInsight PROPERTIES COMPILE_FLAGS "-Wall -Wno-unused-parameter -Wno-reorder -Wno-parentheses -Wno-switch")
|
||||||
# Treat warnings as errors on new gcc versions
|
# Treat warnings as errors on new gcc versions
|
||||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.2)
|
if (RESINSIGHT_TREAT_WARNINGS_AS_ERRORS)
|
||||||
set_target_properties(ResInsight PROPERTIES COMPILE_FLAGS "-Wall -Wno-unused-parameter -Wno-reorder -Wno-parentheses -Wno-switch -Werror")
|
set_target_properties(ResInsight PROPERTIES COMPILE_FLAGS "-Wall -Wno-unused-parameter -Wno-reorder -Wno-parentheses -Wno-switch -Werror")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
Reference in New Issue
Block a user