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 static_library("libxml") {
28 output_name = "libxml2"
30 "chromium/libxml_utils.cc",
31 "chromium/libxml_utils.h",
33 "linux/include/libxml/xmlversion.h",
35 "mac/include/libxml/xmlversion.h",
53 "src/include/libxml/DOCBparser.h",
54 "src/include/libxml/HTMLparser.h",
55 "src/include/libxml/HTMLtree.h",
56 "src/include/libxml/SAX.h",
57 "src/include/libxml/SAX2.h",
58 "src/include/libxml/c14n.h",
59 "src/include/libxml/catalog.h",
60 "src/include/libxml/chvalid.h",
61 "src/include/libxml/debugXML.h",
62 "src/include/libxml/dict.h",
63 "src/include/libxml/encoding.h",
64 "src/include/libxml/entities.h",
65 "src/include/libxml/globals.h",
66 "src/include/libxml/hash.h",
67 "src/include/libxml/list.h",
68 "src/include/libxml/nanoftp.h",
69 "src/include/libxml/nanohttp.h",
70 "src/include/libxml/parser.h",
71 "src/include/libxml/parserInternals.h",
72 "src/include/libxml/pattern.h",
73 "src/include/libxml/relaxng.h",
74 "src/include/libxml/schemasInternals.h",
75 "src/include/libxml/schematron.h",
76 "src/include/libxml/threads.h",
77 "src/include/libxml/tree.h",
78 "src/include/libxml/uri.h",
79 "src/include/libxml/valid.h",
80 "src/include/libxml/xinclude.h",
81 "src/include/libxml/xlink.h",
82 "src/include/libxml/xmlIO.h",
83 "src/include/libxml/xmlautomata.h",
84 "src/include/libxml/xmlerror.h",
85 "src/include/libxml/xmlexports.h",
86 "src/include/libxml/xmlmemory.h",
87 "src/include/libxml/xmlmodule.h",
88 "src/include/libxml/xmlreader.h",
89 "src/include/libxml/xmlregexp.h",
90 "src/include/libxml/xmlsave.h",
91 "src/include/libxml/xmlschemas.h",
92 "src/include/libxml/xmlschemastypes.h",
93 "src/include/libxml/xmlstring.h",
94 "src/include/libxml/xmlunicode.h",
95 "src/include/libxml/xmlwriter.h",
96 "src/include/libxml/xpath.h",
97 "src/include/libxml/xpathInternals.h",
98 "src/include/libxml/xpointer.h",
99 "src/include/win32config.h",
100 "src/include/wsockcompat.h",
107 "src/parserInternals.c",
133 "src/xmlschemastypes.c",
140 "win32/include/libxml/xmlversion.h",
143 configs -= [ "//build/config/compiler:chromium_code" ]
144 configs += [ "//build/config/compiler:no_chromium_code" ]
146 public_configs = [ ":libxml_config" ]
148 "//third_party/icu:icuuc",
151 "//third_party/zlib",
155 cflags_c = [ "/wd4101" ] # Unreferenced local variable.
156 } else if (is_mac || is_android) {
157 # http://www.xmlsoft.org/threads.html says that this is required when using
158 # libxml from several threads, which can possibly happen in chrome. On
159 # linux, this is picked up by transitivity from pkg-config output from
160 # build/linux/system.gyp.
161 defines = [ "_REENTRANT" ]
166 # libxml passes `const unsigned char*` through `const char*`.
169 # pattern.c and uri.c both have an intentional `for (...);` /
170 # `while(...);` loop. I submitted a patch to move the `'` to its own
171 # line, but until that's landed suppress the warning:
174 # debugXML.c compares array 'arg' to NULL.
175 "-Wno-tautological-pointer-compare",
177 # threads.c attempts to forward declare a pthread_equal which doesn't
178 # match the prototype in pthreads.h
179 "-Wno-ignored-attributes",
183 include_dirs = [ "$os_include" ]