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 | |
59 static_library("libxml") { | 27 static_library("libxml") { |
60 output_name = "libxml2" | 28 output_name = "libxml2" |
61 sources = [ | 29 sources = [ |
62 "chromium/libxml_utils.cc", | 30 "chromium/libxml_utils.cc", |
63 "chromium/libxml_utils.h", | 31 "chromium/libxml_utils.h", |
64 "linux/config.h", | 32 "linux/config.h", |
65 "linux/include/libxml/xmlversion.h", | 33 "linux/include/libxml/xmlversion.h", |
66 "mac/config.h", | 34 "mac/config.h", |
67 "mac/include/libxml/xmlversion.h", | 35 "mac/include/libxml/xmlversion.h", |
68 "src/DOCBparser.c", | 36 "src/DOCBparser.c", |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 "src/xpath.c", | 137 "src/xpath.c", |
170 "src/xpointer.c", | 138 "src/xpointer.c", |
171 | 139 |
172 #"src/xzlib.c", | 140 #"src/xzlib.c", |
173 "src/xzlib.h", | 141 "src/xzlib.h", |
174 "win32/config.h", | 142 "win32/config.h", |
175 "win32/include/libxml/xmlversion.h", | 143 "win32/include/libxml/xmlversion.h", |
176 ] | 144 ] |
177 | 145 |
178 configs -= [ "//build/config/compiler:chromium_code" ] | 146 configs -= [ "//build/config/compiler:chromium_code" ] |
179 configs += [ | 147 configs += [ "//build/config/compiler:no_chromium_code" ] |
180 ":libxml_warnings", | |
181 "//build/config/compiler:no_chromium_code", | |
182 ] | |
183 | 148 |
184 public_configs = [ ":libxml_config" ] | 149 public_configs = [ ":libxml_config" ] |
185 public_deps = [ | 150 public_deps = [ |
186 "//third_party/icu:icuuc", | 151 "//third_party/icu:icuuc", |
187 ] | 152 ] |
188 deps = [ | 153 deps = [ |
189 "//third_party/zlib", | 154 "//third_party/zlib", |
190 ] | 155 ] |
191 | 156 |
192 if (is_win) { | 157 if (is_win) { |
193 cflags_c = [ | 158 cflags_c = [ |
194 "/wd4018", # Signed/unsigned mismatch in comparison. | 159 "/wd4018", # Signed/unsigned mismatch in comparison. |
195 "/wd4101", # Unreferenced local variable. | 160 "/wd4101", # Unreferenced local variable. |
196 ] | 161 ] |
197 } else if (is_mac || is_ios || is_android) { | 162 } else if (is_mac || is_ios || is_android) { |
198 # http://www.xmlsoft.org/threads.html says that this is required when using | 163 # http://www.xmlsoft.org/threads.html says that this is required when using |
199 # libxml from several threads, which can possibly happen in chrome. On | 164 # libxml from several threads, which can possibly happen in chrome. On |
200 # linux, this is picked up by transitivity from pkg-config output from | 165 # linux, this is picked up by transitivity from pkg-config output from |
201 # build/linux/system.gyp. | 166 # build/linux/system.gyp. |
202 defines = [ "_REENTRANT" ] | 167 defines = [ "_REENTRANT" ] |
203 } | 168 } |
204 | 169 |
| 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 |
205 include_dirs = [ "$os_include" ] | 203 include_dirs = [ "$os_include" ] |
206 } | 204 } |
OLD | NEW |