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>
This commit is contained in:
Mike Klein 2016-11-16 12:13:44 -05:00 committed by Skia Commit-Bot
parent a8f0002f0c
commit 50500ad470
4 changed files with 31 additions and 2 deletions

View File

@ -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") {

View File

@ -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

View File

@ -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" ]

View File

@ -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"