Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: third_party/libxml/BUILD.gn

Issue 1318823008: Un-nest configs in GN files. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/libxml/BUILD.gn
diff --git a/third_party/libxml/BUILD.gn b/third_party/libxml/BUILD.gn
index c9676088ac2ff77225ef5a0e4841295b0aa79310..39b596230427f48f8d285d1e0c8969dcc1703d76 100644
--- a/third_party/libxml/BUILD.gn
+++ b/third_party/libxml/BUILD.gn
@@ -24,6 +24,38 @@ config("libxml_config") {
]
}
+config("libxml_warnings") {
+ if (is_clang) {
+ cflags = [
+ # libxml passes `const unsigned char*` through `const char*`.
+ "-Wno-pointer-sign",
+
+ # pattern.c and uri.c both have an intentional `for (...);` /
+ # `while(...);` loop. I submitted a patch to move the `'` to its own
+ # line, but until that's landed suppress the warning:
+ "-Wno-empty-body",
+
+ # debugXML.c compares array 'arg' to NULL.
+ "-Wno-tautological-pointer-compare",
+
+ # threads.c attempts to forward declare a pthread_equal which doesn't
+ # match the prototype in pthreads.h
+ "-Wno-ignored-attributes",
+
+ # libxml casts from int to long to void*.
+ "-Wno-int-to-void-pointer-cast",
+
+ # libxml passes a volatile LPCRITICAL_SECTION* to a function expecting
+ # a void* volatile*.
+ "-Wno-incompatible-pointer-types",
+
+ # trio_is_special_quantity and trio_is_negative are only
+ # used with certain preprocessor defines set.
+ "-Wno-unused-function",
+ ]
+ }
+}
+
static_library("libxml") {
output_name = "libxml2"
sources = [
@@ -144,7 +176,10 @@ static_library("libxml") {
]
configs -= [ "//build/config/compiler:chromium_code" ]
- configs += [ "//build/config/compiler:no_chromium_code" ]
+ configs += [
+ ":libxml_warnings",
+ "//build/config/compiler:no_chromium_code",
+ ]
public_configs = [ ":libxml_config" ]
public_deps = [
@@ -167,38 +202,5 @@ static_library("libxml") {
defines = [ "_REENTRANT" ]
}
- config("libxml_warnings") {
- if (is_clang) {
- cflags = [
- # libxml passes `const unsigned char*` through `const char*`.
- "-Wno-pointer-sign",
-
- # pattern.c and uri.c both have an intentional `for (...);` /
- # `while(...);` loop. I submitted a patch to move the `'` to its own
- # line, but until that's landed suppress the warning:
- "-Wno-empty-body",
-
- # debugXML.c compares array 'arg' to NULL.
- "-Wno-tautological-pointer-compare",
-
- # threads.c attempts to forward declare a pthread_equal which doesn't
- # match the prototype in pthreads.h
- "-Wno-ignored-attributes",
-
- # libxml casts from int to long to void*.
- "-Wno-int-to-void-pointer-cast",
-
- # libxml passes a volatile LPCRITICAL_SECTION* to a function expecting
- # a void* volatile*.
- "-Wno-incompatible-pointer-types",
-
- # trio_is_special_quantity and trio_is_negative are only
- # used with certain preprocessor defines set.
- "-Wno-unused-function",
- ]
- }
- }
- configs += [ ":libxml_warnings" ]
-
include_dirs = [ "$os_include" ]
}

Powered by Google App Engine
This is Rietveld 408576698