Index: chrome/browser/ui/libgtk2ui/BUILD.gn |
diff --git a/chrome/browser/ui/libgtk2ui/BUILD.gn b/chrome/browser/ui/libgtk2ui/BUILD.gn |
index 0d34b7a1a5be1baddb5d94857396fbccb6eb1b10..c5e1668b56b3d8e544c37928d9f8657f89438087 100644 |
--- a/chrome/browser/ui/libgtk2ui/BUILD.gn |
+++ b/chrome/browser/ui/libgtk2ui/BUILD.gn |
@@ -72,12 +72,6 @@ component("libgtk2ui") { |
"gconf_listener.h", |
] |
} |
- if (is_clang) { |
- # G_DEFINE_TYPE automatically generates a *get_instance_private inline |
- # function after glib 2.37. That's unused. Prevent to complain about it. |
- cflags = [ "-Wno-unused-function" ] |
- } |
- |
defines = [ "LIBGTK2UI_IMPLEMENTATION" ] |
configs += [ |
@@ -87,6 +81,23 @@ component("libgtk2ui") { |
"//printing:cups", |
] |
+ # gn orders flags on a target before flags from configs. The default config |
+ # adds -Wall, and these flags have to be after -Wall -- so they need to come |
+ # from a config and can't be on the target directly. |
+ config("libgtk2ui_warnings") { |
+ if (is_clang) { |
+ cflags = [ |
+ # G_DEFINE_TYPE automatically generates a *get_instance_private inline |
+ # function after glib 2.37. That's unused. Prevent to complain about it. |
+ "-Wno-unused-function", |
+ |
+ # G_STATIC_ASSERT uses a typedef as a static_assert. |
+ "-Wno-unused-local-typedef", |
+ ] |
+ } |
+ } |
+ configs += [ ":libgtk2ui_warnings", ] |
+ |
deps = [ |
"//base", |
"//base:i18n", |