OLD | NEW |
---|---|
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 # Define an "os_include" variable that points at the OS-specific generated | 5 # Define an "os_include" variable that points at the OS-specific generated |
6 # headers. These were generated by running the configure script offline. | 6 # headers. These were generated by running the configure script offline. |
7 if (is_linux || is_android || is_nacl) { | 7 if (is_linux || is_android || is_nacl) { |
8 os_include = "linux" | 8 os_include = "linux" |
9 } else if (is_mac || is_ios) { | 9 } else if (is_mac || is_ios) { |
10 os_include = "mac" | 10 os_include = "mac" |
11 } else if (is_win) { | 11 } else if (is_win) { |
12 os_include = "win32" | 12 os_include = "win32" |
13 } | 13 } |
14 | 14 |
15 config("libxml_config") { | 15 config("libxml_config") { |
16 # Define LIBXML_STATIC as nothing to match how libxml.h (an internal header) | 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 | 17 # defines LIBXML_STATIC, otherwise we get the macro redefined warning from |
18 # GCC. ("defines" does "-DFOO" which defines the macro FOO as 1.) | 18 # GCC. ("defines" does "-DFOO" which defines the macro FOO as 1.) |
19 cflags = [ "-DLIBXML_STATIC=" ] | 19 cflags = [ "-DLIBXML_STATIC=" ] |
20 | 20 |
21 include_dirs = [ | 21 include_dirs = [ |
22 "src/include", | 22 "src/include", |
23 "$os_include/include", | 23 "$os_include/include", |
24 ] | 24 ] |
25 } | 25 } |
26 | 26 |
27 config("libxml_warnings") { | |
28 if (is_clang) { | |
29 cflags = [ | |
30 # libxml passes `const unsigned char*` through `const char*`. | |
31 "-Wno-pointer-sign", | |
32 | |
33 # pattern.c and uri.c both have an intentional `for (...);` / | |
34 # `while(...);` loop. I submitted a patch to move the `'` to its own | |
35 # line, but until that's landed suppress the warning: | |
36 "-Wno-empty-body", | |
37 | |
38 # debugXML.c compares array 'arg' to NULL. | |
39 "-Wno-tautological-pointer-compare", | |
40 | |
41 # threads.c attempts to forward declare a pthread_equal which doesn't | |
42 # match the prototype in pthreads.h | |
43 "-Wno-ignored-attributes", | |
44 | |
45 # libxml casts from int to long to void*. | |
46 "-Wno-int-to-void-pointer-cast", | |
47 | |
48 # libxml passes a volatile LPCRITICAL_SECTION* to a function expecting | |
49 # a void* volatile*. | |
50 "-Wno-incompatible-pointer-types", | |
51 | |
52 # trio_is_special_quantity and trio_is_negative are only | |
53 # used with certain preprocessor defines set. | |
54 "-Wno-unused-function", | |
55 ] | |
56 } | |
57 } | |
58 | |
27 static_library("libxml") { | 59 static_library("libxml") { |
28 output_name = "libxml2" | 60 output_name = "libxml2" |
29 sources = [ | 61 sources = [ |
30 "chromium/libxml_utils.cc", | 62 "chromium/libxml_utils.cc", |
31 "chromium/libxml_utils.h", | 63 "chromium/libxml_utils.h", |
32 "linux/config.h", | 64 "linux/config.h", |
33 "linux/include/libxml/xmlversion.h", | 65 "linux/include/libxml/xmlversion.h", |
34 "mac/config.h", | 66 "mac/config.h", |
35 "mac/include/libxml/xmlversion.h", | 67 "mac/include/libxml/xmlversion.h", |
36 "src/DOCBparser.c", | 68 "src/DOCBparser.c", |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
137 "src/xpath.c", | 169 "src/xpath.c", |
138 "src/xpointer.c", | 170 "src/xpointer.c", |
139 | 171 |
140 #"src/xzlib.c", | 172 #"src/xzlib.c", |
141 "src/xzlib.h", | 173 "src/xzlib.h", |
142 "win32/config.h", | 174 "win32/config.h", |
143 "win32/include/libxml/xmlversion.h", | 175 "win32/include/libxml/xmlversion.h", |
144 ] | 176 ] |
145 | 177 |
146 configs -= [ "//build/config/compiler:chromium_code" ] | 178 configs -= [ "//build/config/compiler:chromium_code" ] |
147 configs += [ "//build/config/compiler:no_chromium_code" ] | 179 configs += [ |
180 "//build/config/compiler:no_chromium_code", | |
181 | |
182 # Must be after no_chromium_code for warning flags to be ordered correctly. | |
183 ":libxml_warnings", | |
184 ] | |
148 | 185 |
149 public_configs = [ ":libxml_config" ] | 186 public_configs = [ ":libxml_config" ] |
150 public_deps = [ | 187 public_deps = [ |
151 "//third_party/icu:icuuc", | 188 "//third_party/icu:icuuc", |
152 ] | 189 ] |
153 deps = [ | 190 deps = [ |
154 "//third_party/zlib", | 191 "//third_party/zlib", |
155 ] | 192 ] |
156 | 193 |
157 if (is_win) { | 194 if (is_win) { |
158 cflags_c = [ | 195 cflags_c = [ |
159 "/wd4018", # Signed/unsigned mismatch in comparison. | 196 "/wd4018", # Signed/unsigned mismatch in comparison. |
160 "/wd4101", # Unreferenced local variable. | 197 "/wd4101", # Unreferenced local variable. |
161 ] | 198 ] |
Nico
2015/09/02 17:05:36
(maybe this should move into the config too so tha
| |
162 } else if (is_mac || is_ios || is_android) { | 199 } else if (is_mac || is_ios || is_android) { |
163 # http://www.xmlsoft.org/threads.html says that this is required when using | 200 # http://www.xmlsoft.org/threads.html says that this is required when using |
164 # libxml from several threads, which can possibly happen in chrome. On | 201 # libxml from several threads, which can possibly happen in chrome. On |
165 # linux, this is picked up by transitivity from pkg-config output from | 202 # linux, this is picked up by transitivity from pkg-config output from |
166 # build/linux/system.gyp. | 203 # build/linux/system.gyp. |
167 defines = [ "_REENTRANT" ] | 204 defines = [ "_REENTRANT" ] |
168 } | 205 } |
169 | 206 |
170 config("libxml_warnings") { | |
171 if (is_clang) { | |
172 cflags = [ | |
173 # libxml passes `const unsigned char*` through `const char*`. | |
174 "-Wno-pointer-sign", | |
175 | |
176 # pattern.c and uri.c both have an intentional `for (...);` / | |
177 # `while(...);` loop. I submitted a patch to move the `'` to its own | |
178 # line, but until that's landed suppress the warning: | |
179 "-Wno-empty-body", | |
180 | |
181 # debugXML.c compares array 'arg' to NULL. | |
182 "-Wno-tautological-pointer-compare", | |
183 | |
184 # threads.c attempts to forward declare a pthread_equal which doesn't | |
185 # match the prototype in pthreads.h | |
186 "-Wno-ignored-attributes", | |
187 | |
188 # libxml casts from int to long to void*. | |
189 "-Wno-int-to-void-pointer-cast", | |
190 | |
191 # libxml passes a volatile LPCRITICAL_SECTION* to a function expecting | |
192 # a void* volatile*. | |
193 "-Wno-incompatible-pointer-types", | |
194 | |
195 # trio_is_special_quantity and trio_is_negative are only | |
196 # used with certain preprocessor defines set. | |
197 "-Wno-unused-function", | |
198 ] | |
199 } | |
200 } | |
201 configs += [ ":libxml_warnings" ] | |
202 | |
203 include_dirs = [ "$os_include" ] | 207 include_dirs = [ "$os_include" ] |
204 } | 208 } |
OLD | NEW |