diff options
-rw-r--r-- | BUILD.gn | 18 | ||||
-rw-r--r-- | gn/BUILD.gn | 6 | ||||
-rw-r--r-- | gn/BUILDCONFIG.gn | 1 | ||||
-rw-r--r-- | tools/public_headers_warnings_check.cpp | 8 |
4 files changed, 31 insertions, 2 deletions
@@ -686,7 +686,11 @@ component("skia") { } } +config("skia.h_config") { + include_dirs = [ "$target_gen_dir" ] +} action("skia.h") { + public_configs = [ ":skia.h_config" ] skia_h = "$target_gen_dir/skia.h" script = "gn/find_headers.py" args = [ rebase_path(skia_h, root_build_dir) ] + @@ -701,7 +705,6 @@ if (skia_enable_gpu && target_cpu == "x64") { # Our bots only have 64-bit libOSMesa installed. # TODO: worth fixing? executable("fiddle") { - include_dirs = [ "$target_gen_dir" ] libs = [] if (is_linux) { libs += [ "OSMesa" ] @@ -719,6 +722,19 @@ if (skia_enable_gpu && target_cpu == "x64") { } } +if (is_skia_standalone) { + source_set("public_headers_warnings_check") { + sources = [ + "tools/public_headers_warnings_check.cpp", + ] + configs -= [ "//gn:warnings_except_public_headers" ] + deps = [ + ":skia", + ":skia.h", + ] + } +} + # Targets guarded by skia_enable_tools may use //third_party freely. if (skia_enable_tools) { template("test_lib") { diff --git a/gn/BUILD.gn b/gn/BUILD.gn index 3c20c96a6b..60dddffd40 100644 --- a/gn/BUILD.gn +++ b/gn/BUILD.gn @@ -276,7 +276,6 @@ config("warnings") { "-Wvla", "-Wno-deprecated-declarations", - "-Wno-unused-parameter", ] cflags_cc += [ "-Wnon-virtual-dtor" ] @@ -347,6 +346,11 @@ config("warnings") { } } } +config("warnings_except_public_headers") { + if (!is_win) { + cflags = [ "-Wno-unused-parameter" ] + } +} config("extra_flags") { cflags = extra_cflags diff --git a/gn/BUILDCONFIG.gn b/gn/BUILDCONFIG.gn index 4ed566866e..a775d499b6 100644 --- a/gn/BUILDCONFIG.gn +++ b/gn/BUILDCONFIG.gn @@ -114,6 +114,7 @@ default_configs = [ "//gn:no_exceptions", "//gn:no_rtti", "//gn:warnings", + "//gn:warnings_except_public_headers", ] if (!is_debug) { default_configs += [ "//gn:release" ] diff --git a/tools/public_headers_warnings_check.cpp b/tools/public_headers_warnings_check.cpp new file mode 100644 index 0000000000..20573f6052 --- /dev/null +++ b/tools/public_headers_warnings_check.cpp @@ -0,0 +1,8 @@ +/* + * Copyright 2016 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#include "skia.h" |