Make CrosDBusService chrome-independent
[chromium-blink-merge.git] / third_party / libxml / libxml.gyp
blobdcc75b90b81bae246ac6c0742a28fb5486a86bb7
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.
6   'variables': {
7     'conditions': [
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"', {
11         'os_include': 'linux'
12       }],
13       ['OS=="mac"', {'os_include': 'mac'}],
14       ['OS=="win"', {'os_include': 'win32'}],
15     ],
16     'use_system_libxml%': 0,
17   },
18   'targets': [
19     {
20       'target_name': 'libxml',
21       'conditions': [
22         ['use_system_libxml', {
23           'conditions': [
24             ['os_posix == 1 and OS != "mac" and OS != "ios"', {
25               'type': 'static_library',
26               'sources': [
27                 'chromium/libxml_utils.h',
28                 'chromium/libxml_utils.cc',
29               ],
30               'cflags': [
31                 '<!@(pkg-config --cflags libxml-2.0)',
32               ],
33               'defines': [
34                 'USE_SYSTEM_LIBXML',
35               ],
36               'direct_dependent_settings': {
37                 'cflags': [
38                   '<!@(pkg-config --cflags libxml-2.0)',
39                 ],
40                 'defines': [
41                   'USE_SYSTEM_LIBXML',
42                 ],
43               },
44               'link_settings': {
45                 'ldflags': [
46                   '<!@(pkg-config --libs-only-L --libs-only-other libxml-2.0)',
47                 ],
48                 'libraries': [
49                   '<!@(pkg-config --libs-only-l libxml-2.0)',
50                 ],
51               },
52             }],
53             ['OS == "ios"', {
54               'type': 'static_library',
55               'sources': [
56                 'chromium/libxml_utils.h',
57                 'chromium/libxml_utils.cc',
58               ],
59               'include_dirs': [
60                 '$(SDKROOT)/usr/include/libxml2',
61               ],
62               'all_dependent_settings': {
63                 'defines': [
64                   'USE_SYSTEM_LIBXML',
65                 ],
66                 'include_dirs': [
67                   '$(SDKROOT)/usr/include/libxml2',
68                 ],
69               },
70               'link_settings': {
71                 'libraries': [
72                   '$(SDKROOT)/usr/lib/libxml2.dylib',
73                 ],
74               },
75             }],
76           ],
77         }, {  # else: !use_system_libxml
78           'type': 'static_library',
79           'sources': [
80             'chromium/libxml_utils.h',
81             'chromium/libxml_utils.cc',
82             'linux/config.h',
83             'linux/include/libxml/xmlversion.h',
84             'mac/config.h',
85             'mac/include/libxml/xmlversion.h',
86             'src/include/libxml/c14n.h',
87             'src/include/libxml/catalog.h',
88             'src/include/libxml/chvalid.h',
89             'src/include/libxml/debugXML.h',
90             'src/include/libxml/dict.h',
91             'src/include/libxml/DOCBparser.h',
92             'src/include/libxml/encoding.h',
93             'src/include/libxml/entities.h',
94             'src/include/libxml/globals.h',
95             'src/include/libxml/hash.h',
96             'src/include/libxml/HTMLparser.h',
97             'src/include/libxml/HTMLtree.h',
98             'src/include/libxml/list.h',
99             'src/include/libxml/nanoftp.h',
100             'src/include/libxml/nanohttp.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',
134             'src/acconfig.h',
135             'src/c14n.c',
136             'src/catalog.c',
137             'src/chvalid.c',
138             'src/debugXML.c',
139             'src/dict.c',
140             'src/DOCBparser.c',
141             'src/elfgcchack.h',
142             'src/encoding.c',
143             'src/entities.c',
144             'src/error.c',
145             'src/globals.c',
146             'src/hash.c',
147             'src/HTMLparser.c',
148             'src/HTMLtree.c',
149             'src/legacy.c',
150             'src/libxml.h',
151             'src/list.c',
152             'src/nanoftp.c',
153             'src/nanohttp.c',
154             'src/parser.c',
155             'src/parserInternals.c',
156             'src/pattern.c',
157             'src/relaxng.c',
158             'src/SAX.c',
159             'src/SAX2.c',
160             'src/schematron.c',
161             'src/threads.c',
162             'src/tree.c',
163             #'src/trio.c',
164             #'src/trio.h',
165             #'src/triodef.h',
166             #'src/trionan.c',
167             #'src/trionan.h',
168             #'src/triop.h',
169             #'src/triostr.c',
170             #'src/triostr.h',
171             'src/uri.c',
172             'src/valid.c',
173             'src/xinclude.c',
174             'src/xlink.c',
175             'src/xmlIO.c',
176             'src/xmlmemory.c',
177             'src/xmlmodule.c',
178             'src/xmlreader.c',
179             'src/xmlregexp.c',
180             'src/xmlsave.c',
181             'src/xmlschemas.c',
182             'src/xmlschemastypes.c',
183             'src/xmlstring.c',
184             'src/xmlunicode.c',
185             'src/xmlwriter.c',
186             'src/xpath.c',
187             'src/xpointer.c',
188             'win32/config.h',
189             'win32/include/libxml/xmlversion.h',
190           ],
191           'defines': [
192             # Define LIBXML_STATIC as nothing to match how libxml.h
193             # (an internal header) defines LIBXML_STATIC, otherwise
194             # we get the macro redefined warning from GCC.  (-DFOO
195             # defines the macro FOO as 1.)
196             'LIBXML_STATIC=',
197           ],
198           'variables': {
199             'clang_warning_flags': [
200               # libxml passes `const unsigned char*` through `const char*`.
201               '-Wno-pointer-sign',
202               # pattern.c and uri.c both have an intentional
203               # `for (...);` / `while(...);` loop. I submitted a patch to
204               # move the `'` to its own line, but until that's landed
205               # suppress the warning:
206               '-Wno-empty-body',
207               # debugXML.c compares array 'arg' to NULL.
208               '-Wno-tautological-pointer-compare',
209               # See http://crbug.com/138571#c8
210               '-Wno-ignored-attributes',
211             ],
212           },
213           'include_dirs': [
214             '<(os_include)',
215             '<(os_include)/include',
216             'src/include',
217           ],
218           'dependencies': [
219             '../icu/icu.gyp:icuuc',
220             '../zlib/zlib.gyp:zlib',
221           ],
222           'export_dependent_settings': [
223             '../icu/icu.gyp:icuuc',
224           ],
225           'direct_dependent_settings': {
226             'defines': [
227               'LIBXML_STATIC',
228             ],
229             'include_dirs': [
230               '<(os_include)/include',
231               'src/include',
232             ],
233           },
234           'conditions': [
235             ['OS=="linux"', {
236               'link_settings': {
237                 'libraries': [
238                   # We need dl for dlopen() and friends.
239                   '-ldl',
240                 ],
241               },
242             }],
243             # http://www.xmlsoft.org/threads.html says that this is required
244             # when using libxml from several threads, which can possibly happen
245             # in chrome. On linux, this is picked up by transitivity from
246             # pkg-config output from build/linux/system.gyp.
247             ['OS=="mac" or OS=="android"', {'defines': ['_REENTRANT']}],
248             ['OS=="win"', {
249               'product_name': 'libxml2',
250               # Disable unimportant 'unused variable' warning, and
251               # signed/unsigned comparison warning. The signed/unsigned (4101)
252               # is fixed upstream and can be removed eventually.
253               # TODO(jschuh): http://crbug.com/167187 size_t -> int
254               'msvs_disabled_warnings': [ 4018, 4101, 4267 ],
255             }, {  # else: OS!="win"
256               'product_name': 'xml2',
257             }],
258           ],
259         }],
260         ['OS == "ios"', {
261           'toolsets': ['host', 'target'],
262         }],
263       ],
264     },
265   ],