Remove obsolete entries from .gitignore.
[chromium-blink-merge.git] / third_party / libxml / BUILD.gn
blob5e633c04b384ed809b6e8201f4f32968a36e17ad
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) {
8   os_include = "linux"
9 } else if (is_mac || is_ios) {
10   os_include = "mac"
11 } else if (is_win) {
12   os_include = "win32"
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=" ]
21   include_dirs = [
22     "src/include",
23     "$os_include/include",
24   ]
27 config("libxml_warnings") {
28   if (is_win) {
29     cflags_c = [
30       "/wd4018",  # Signed/unsigned mismatch in comparison.
31       "/wd4101",  # Unreferenced local variable.
32     ]
33   }
34   if (is_clang) {
35     cflags = [
36       # libxml passes `const unsigned char*` through `const char*`.
37       "-Wno-pointer-sign",
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:
42       "-Wno-empty-body",
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
55       # a void* volatile*.
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",
61     ]
62   }
65 static_library("libxml") {
66   output_name = "libxml2"
67   sources = [
68     "chromium/libxml_utils.cc",
69     "chromium/libxml_utils.h",
70     "linux/config.h",
71     "linux/include/libxml/xmlversion.h",
72     "mac/config.h",
73     "mac/include/libxml/xmlversion.h",
74     "src/DOCBparser.c",
75     "src/HTMLparser.c",
76     "src/HTMLtree.c",
77     "src/SAX.c",
78     "src/SAX2.c",
79     "src/buf.c",
80     "src/buf.h",
81     "src/c14n.c",
82     "src/catalog.c",
83     "src/chvalid.c",
84     "src/debugXML.c",
85     "src/dict.c",
86     "src/elfgcchack.h",
87     "src/enc.h",
88     "src/encoding.c",
89     "src/entities.c",
90     "src/error.c",
91     "src/globals.c",
92     "src/hash.c",
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",
139     "src/legacy.c",
140     "src/libxml.h",
141     "src/list.c",
142     "src/parser.c",
143     "src/parserInternals.c",
144     "src/pattern.c",
145     "src/relaxng.c",
146     "src/save.h",
147     "src/schematron.c",
148     "src/threads.c",
149     "src/timsort.h",
150     "src/tree.c",
152     #"src/trio.c",
153     #"src/trio.h",
154     #"src/triodef.h",
155     #"src/trionan.c",
156     #"src/trionan.h",
157     #"src/triop.h",
158     #"src/triostr.c",
159     #"src/triostr.h",
160     "src/uri.c",
161     "src/valid.c",
162     "src/xinclude.c",
163     "src/xlink.c",
164     "src/xmlIO.c",
165     "src/xmlmemory.c",
166     "src/xmlmodule.c",
167     "src/xmlreader.c",
168     "src/xmlregexp.c",
169     "src/xmlsave.c",
170     "src/xmlschemas.c",
171     "src/xmlschemastypes.c",
172     "src/xmlstring.c",
173     "src/xmlunicode.c",
174     "src/xmlwriter.c",
175     "src/xpath.c",
176     "src/xpointer.c",
178     #"src/xzlib.c",
179     "src/xzlib.h",
180     "win32/config.h",
181     "win32/include/libxml/xmlversion.h",
182   ]
184   configs -= [ "//build/config/compiler:chromium_code" ]
185   configs += [
186     "//build/config/compiler:no_chromium_code",
188     # Must be after no_chromium_code for warning flags to be ordered correctly.
189     ":libxml_warnings",
190   ]
192   public_configs = [ ":libxml_config" ]
193   public_deps = [
194     "//third_party/icu:icuuc",
195   ]
196   deps = [
197     "//third_party/zlib",
198   ]
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" ]
206   }
208   include_dirs = [ "$os_include" ]