1 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 # Define an "os_include" variable that points at the OS-specific generated
6 # headers. These were generated by running the configure script offline.
7 if (is_linux || is_android || is_nacl) {
9 } else if (is_mac || is_ios) {
15 config("libxml_config") {
16 # Define LIBXML_STATIC as nothing to match how libxml.h (an internal header)
17 # defines LIBXML_STATIC, otherwise we get the macro redefined warning from
18 # GCC. ("defines" does "-DFOO" which defines the macro FOO as 1.)
19 cflags = [ "-DLIBXML_STATIC=" ]
23 "$os_include/include",
27 config("libxml_warnings") {
30 "/wd4018", # Signed/unsigned mismatch in comparison.
31 "/wd4101", # Unreferenced local variable.
36 # libxml passes `const unsigned char*` through `const char*`.
39 # pattern.c and uri.c both have an intentional `for (...);` /
40 # `while(...);` loop. I submitted a patch to move the `'` to its own
41 # line, but until that's landed suppress the warning:
44 # debugXML.c compares array 'arg' to NULL.
45 "-Wno-tautological-pointer-compare",
47 # threads.c attempts to forward declare a pthread_equal which doesn't
48 # match the prototype in pthreads.h
49 "-Wno-ignored-attributes",
51 # libxml casts from int to long to void*.
52 "-Wno-int-to-void-pointer-cast",
54 # libxml passes a volatile LPCRITICAL_SECTION* to a function expecting
56 "-Wno-incompatible-pointer-types",
58 # trio_is_special_quantity and trio_is_negative are only
59 # used with certain preprocessor defines set.
60 "-Wno-unused-function",
65 static_library("libxml") {
66 output_name = "libxml2"
68 "chromium/libxml_utils.cc",
69 "chromium/libxml_utils.h",
71 "linux/include/libxml/xmlversion.h",
73 "mac/include/libxml/xmlversion.h",
93 "src/include/libxml/DOCBparser.h",
94 "src/include/libxml/HTMLparser.h",
95 "src/include/libxml/HTMLtree.h",
96 "src/include/libxml/SAX.h",
97 "src/include/libxml/SAX2.h",
98 "src/include/libxml/c14n.h",
99 "src/include/libxml/catalog.h",
100 "src/include/libxml/chvalid.h",
101 "src/include/libxml/debugXML.h",
102 "src/include/libxml/dict.h",
103 "src/include/libxml/encoding.h",
104 "src/include/libxml/entities.h",
105 "src/include/libxml/globals.h",
106 "src/include/libxml/hash.h",
107 "src/include/libxml/list.h",
108 "src/include/libxml/parser.h",
109 "src/include/libxml/parserInternals.h",
110 "src/include/libxml/pattern.h",
111 "src/include/libxml/relaxng.h",
112 "src/include/libxml/schemasInternals.h",
113 "src/include/libxml/schematron.h",
114 "src/include/libxml/threads.h",
115 "src/include/libxml/tree.h",
116 "src/include/libxml/uri.h",
117 "src/include/libxml/valid.h",
118 "src/include/libxml/xinclude.h",
119 "src/include/libxml/xlink.h",
120 "src/include/libxml/xmlIO.h",
121 "src/include/libxml/xmlautomata.h",
122 "src/include/libxml/xmlerror.h",
123 "src/include/libxml/xmlexports.h",
124 "src/include/libxml/xmlmemory.h",
125 "src/include/libxml/xmlmodule.h",
126 "src/include/libxml/xmlreader.h",
127 "src/include/libxml/xmlregexp.h",
128 "src/include/libxml/xmlsave.h",
129 "src/include/libxml/xmlschemas.h",
130 "src/include/libxml/xmlschemastypes.h",
131 "src/include/libxml/xmlstring.h",
132 "src/include/libxml/xmlunicode.h",
133 "src/include/libxml/xmlwriter.h",
134 "src/include/libxml/xpath.h",
135 "src/include/libxml/xpathInternals.h",
136 "src/include/libxml/xpointer.h",
137 "src/include/win32config.h",
138 "src/include/wsockcompat.h",
143 "src/parserInternals.c",
171 "src/xmlschemastypes.c",
181 "win32/include/libxml/xmlversion.h",
184 configs -= [ "//build/config/compiler:chromium_code" ]
186 "//build/config/compiler:no_chromium_code",
188 # Must be after no_chromium_code for warning flags to be ordered correctly.
192 public_configs = [ ":libxml_config" ]
194 "//third_party/icu:icuuc",
197 "//third_party/zlib",
200 if (is_mac || is_ios || is_android) {
201 # http://www.xmlsoft.org/threads.html says that this is required when using
202 # libxml from several threads, which can possibly happen in chrome. On
203 # linux, this is picked up by transitivity from pkg-config output from
204 # build/linux/system.gyp.
205 defines = [ "_REENTRANT" ]
208 include_dirs = [ "$os_include" ]