Commit 7aafb274 by Ben Clayton Committed by Ben Clayton

Add CMake flag to treat warnings as errors

Disabled by default by the request of Nicolas. Bug: b/123933266 Change-Id: Ie1217dc6c96ec85c9daf8246de785c8729386634 Reviewed-on: https://swiftshader-review.googlesource.com/c/25015Tested-by: 's avatarBen Clayton <bclayton@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
parent b607bc88
......@@ -66,7 +66,8 @@
"command": "cmake",
"args": [
"..",
"-DCMAKE_BUILD_TYPE=${input:buildType}"
"-DCMAKE_BUILD_TYPE=${input:buildType}",
"-DWARNINGS_AS_ERRORS=1"
],
"options": {
"cwd": "${workspaceRoot}/build"
......
......@@ -76,6 +76,7 @@ option (MSAN "Build with memory sanitizer" 0)
option (ASAN "Build with address sanitizer" 0)
option (TSAN "Build with thread sanitizer" 0)
option (UBSAN "Build with undefined behavior sanitizer" 0)
option (WARNINGS_AS_ERRORS "Treat all warnings as errors" 0)
if(ARCH STREQUAL "arm")
set(DEFAULT_REACTOR_BACKEND "Subzero")
......@@ -266,6 +267,10 @@ else()
set_cpp_flag("-s" RELEASE)
endif()
if(WARNINGS_AS_ERRORS)
set_cpp_flag("-Werror") # Treat all warnings as errors
endif()
# Disable pedanitc warnings
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set_cpp_flag("-Wno-ignored-attributes") # ignoring attributes on template argument 'X'
......
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