Force -Wno-shadow to avoid variable shadowing warnings. Long term, ideally, these would be fixed and this flag can be removed. For now, this is an expedient way to allow enabling -Wshadow in Chromium. Bug: chromium:794619 Change-Id: I95f806dd3ec6b162e84596b3a632901af41f41b0 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/57228 Reviewed-by: Nicolas Capens <nicolascapens@google.com> Tested-by: Peter Kasting <pkasting@google.com> Commit-Queue: Peter Kasting <pkasting@google.com>
diff --git a/BUILD.gn b/BUILD.gn index 413c977..37f7de1 100644 --- a/BUILD.gn +++ b/BUILD.gn
@@ -15,7 +15,7 @@ import("src/Reactor/reactor.gni") config("swiftshader_config") { - cflags = [] + cflags = [ "-Wno-shadow" ] defines = [] asmflags = [] @@ -81,6 +81,7 @@ } include_dirs = [ "src/" ] deps = [ "src/OpenGL/libGLESv2:swiftshader_libGLESv2_static" ] + configs += [ ":swiftshader_config" ] } group("swiftshader") {
diff --git a/tests/ReactorUnitTests/BUILD.gn b/tests/ReactorUnitTests/BUILD.gn index 877c0a4..44a46d0 100644 --- a/tests/ReactorUnitTests/BUILD.gn +++ b/tests/ReactorUnitTests/BUILD.gn
@@ -25,6 +25,8 @@ "//third_party/swiftshader/src/Reactor:swiftshader_llvm_reactor", ] + configs += [ "//third_party/swiftshader:swiftshader_config" ] + sources = [ "//gpu/swiftshader_tests_main.cc", "ReactorUnitTests.cpp", @@ -46,6 +48,8 @@ "//third_party/swiftshader/src/Reactor:swiftshader_subzero_reactor", ] + configs += [ "//third_party/swiftshader:swiftshader_config" ] + sources = [ "//gpu/swiftshader_tests_main.cc", "ReactorUnitTests.cpp",