1 # Copyright (c) 2012 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.
8 # Define an "os_include" variable that points at the OS-specific generated
9 # headers. These were generated by running the configure script offline.
10 ['os_posix == 1 and OS != "mac" and OS != "ios"', {
13 ['OS=="mac"', {'os_include': 'mac'}],
14 ['OS=="win"', {'os_include': 'win32'}],
16 'use_system_libxml%': 0,
20 'target_name': 'libxml',
22 ['use_system_libxml', {
24 ['os_posix == 1 and OS != "mac" and OS != "ios"', {
25 'type': 'static_library',
27 'chromium/libxml_utils.h',
28 'chromium/libxml_utils.cc',
31 '<!@(pkg-config --cflags libxml-2.0)',
36 'direct_dependent_settings': {
38 '<!@(pkg-config --cflags libxml-2.0)',
46 '<!@(pkg-config --libs-only-L --libs-only-other libxml-2.0)',
49 '<!@(pkg-config --libs-only-l libxml-2.0)',
54 'type': 'static_library',
56 'chromium/libxml_utils.h',
57 'chromium/libxml_utils.cc',
60 '$(SDKROOT)/usr/include/libxml2',
62 'all_dependent_settings': {
67 '$(SDKROOT)/usr/include/libxml2',
79 }, { # else: !use_system_libxml
80 'type': 'static_library',
82 'chromium/libxml_utils.h',
83 'chromium/libxml_utils.cc',
85 'linux/include/libxml/xmlversion.h',
87 'mac/include/libxml/xmlversion.h',
88 'src/include/libxml/c14n.h',
89 'src/include/libxml/catalog.h',
90 'src/include/libxml/chvalid.h',
91 'src/include/libxml/debugXML.h',
92 'src/include/libxml/dict.h',
93 'src/include/libxml/DOCBparser.h',
94 'src/include/libxml/encoding.h',
95 'src/include/libxml/entities.h',
96 'src/include/libxml/globals.h',
97 'src/include/libxml/hash.h',
98 'src/include/libxml/HTMLparser.h',
99 'src/include/libxml/HTMLtree.h',
100 'src/include/libxml/list.h',
101 'src/include/libxml/parser.h',
102 'src/include/libxml/parserInternals.h',
103 'src/include/libxml/pattern.h',
104 'src/include/libxml/relaxng.h',
105 'src/include/libxml/SAX.h',
106 'src/include/libxml/SAX2.h',
107 'src/include/libxml/schemasInternals.h',
108 'src/include/libxml/schematron.h',
109 'src/include/libxml/threads.h',
110 'src/include/libxml/tree.h',
111 'src/include/libxml/uri.h',
112 'src/include/libxml/valid.h',
113 'src/include/libxml/xinclude.h',
114 'src/include/libxml/xlink.h',
115 'src/include/libxml/xmlautomata.h',
116 'src/include/libxml/xmlerror.h',
117 'src/include/libxml/xmlexports.h',
118 'src/include/libxml/xmlIO.h',
119 'src/include/libxml/xmlmemory.h',
120 'src/include/libxml/xmlmodule.h',
121 'src/include/libxml/xmlreader.h',
122 'src/include/libxml/xmlregexp.h',
123 'src/include/libxml/xmlsave.h',
124 'src/include/libxml/xmlschemas.h',
125 'src/include/libxml/xmlschemastypes.h',
126 'src/include/libxml/xmlstring.h',
127 'src/include/libxml/xmlunicode.h',
128 'src/include/libxml/xmlwriter.h',
129 'src/include/libxml/xpath.h',
130 'src/include/libxml/xpathInternals.h',
131 'src/include/libxml/xpointer.h',
132 'src/include/win32config.h',
133 'src/include/wsockcompat.h',
155 'src/parserInternals.c',
184 'src/xmlschemastypes.c',
193 'win32/include/libxml/xmlversion.h',
196 # Define LIBXML_STATIC as nothing to match how libxml.h
197 # (an internal header) defines LIBXML_STATIC, otherwise
198 # we get the macro redefined warning from GCC. (-DFOO
199 # defines the macro FOO as 1.)
203 'clang_warning_flags': [
204 # libxml passes `const unsigned char*` through `const char*`.
206 # pattern.c and uri.c both have an intentional
207 # `for (...);` / `while(...);` loop. I submitted a patch to
208 # move the `'` to its own line, but until that's landed
209 # suppress the warning:
211 # debugXML.c compares array 'arg' to NULL.
212 '-Wno-tautological-pointer-compare',
213 # See http://crbug.com/138571#c8
214 '-Wno-ignored-attributes',
215 # libxml casts from int to long to void*.
216 '-Wno-int-to-void-pointer-cast',
217 # libxml passes a volatile LPCRITICAL_SECTION* to a function
218 # expecting a void* volatile*.
219 '-Wno-incompatible-pointer-types',
220 # trio_is_special_quantity and trio_is_negative are only
221 # used with certain preprocessor defines set.
222 '-Wno-unused-function',
227 '<(os_include)/include',
231 '../icu/icu.gyp:icuuc',
232 '../zlib/zlib.gyp:zlib',
234 'export_dependent_settings': [
235 '../icu/icu.gyp:icuuc',
237 'direct_dependent_settings': {
242 '<(os_include)/include',
250 # We need dl for dlopen() and friends.
256 # http://www.xmlsoft.org/threads.html says that this is required
257 # when using libxml from several threads, which can possibly happen
258 # in chrome. On linux, this is picked up by transitivity from
259 # pkg-config output from build/linux/system.gyp.
260 ['OS=="mac" or OS=="android"', {'defines': ['_REENTRANT']}],
262 'product_name': 'libxml2',
263 # Disable unimportant 'unused variable' warning, and
264 # signed/unsigned comparison warning. The signed/unsigned (4101)
265 # is fixed upstream and can be removed eventually.
266 # TODO(jschuh): http://crbug.com/167187 size_t -> int
267 'msvs_disabled_warnings': [ 4018, 4101, 4267 ],
268 }, { # else: OS!="win"
269 'product_name': 'xml2',
274 'toolsets': ['host', 'target'],