diff options
author | Mike Klein <mtklein@chromium.org> | 2016-11-16 12:13:44 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-11-16 19:27:29 +0000 |
commit | 50500ad470af3d82c68144fec7e55c9cdffb5d98 (patch) | |
tree | ed2003a12bed7f13a55466a88ce6d59d87f26947 | |
parent | a8f0002f0c2f23167f1e6b3ae3f77d3c7768cac3 (diff) |
GN: add public headers warnings check.
We already generate skia.h to include all public headers for Fiddle.
This just includes it with -Wunused-parameter turned on as an error.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4901
Change-Id: Ia55a901c09a3c9c9d6d35a43259431dba3532ed9
Reviewed-on: https://skia-review.googlesource.com/4901
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
-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" |