From c0d6a3235da44dc29ded5c773db7df0170611cbb Mon Sep 17 00:00:00 2001 From: Hidehiko Abe Date: Thu, 15 Feb 2018 11:09:33 +0900 Subject: Deal with -Wunused-parameter in libchrome build rule. So, now we do not need modification in libchrome to workaround the error. Bug: 73270448 Test: Build locally. Treehugger. Change-Id: I38fe79c1e01fd39a4bdd7121bb58b9b6d9a3da89 --- Android.bp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'Android.bp') diff --git a/Android.bp b/Android.bp index bf4809e30e..202076beec 100644 --- a/Android.bp +++ b/Android.bp @@ -15,6 +15,18 @@ // Common defaults // ======================================================== +// Using Chrome header files directly could cause -Wunused-parameter errors, +// and this is workaround. Please find the document in include_generator.py +// for details. +gensrcs { + name: "libchrome-include", + cmd: "$(location libchrome_tools/include_generator.py) $(in) $(out)", + tool_files: ["libchrome_tools/include_generator.py"], + export_include_dirs: ["."], + srcs: ["**/*.h"], + output_extension: "h", +} + cc_defaults { name: "libchrome-defaults", // Set clang to "true" to force clang or "false" to force gcc. @@ -24,12 +36,18 @@ cc_defaults { "-Wall", "-Werror", "-Wno-deprecated-declarations", + "-Wno-unused-parameter", ], include_dirs: [ "external/valgrind/include", "external/valgrind", ], - export_include_dirs: ["."], + + // Note: Although the generated header files are exported here, in building + // libchrome, "." has priority (unlike building projects using libchrome), + // so the raw header files are used for them. + generated_headers: ["libchrome-include"], + export_generated_headers: ["libchrome-include"], target: { host: { cflags: [ -- cgit v1.2.3