| 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_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", |
| 38 |
| 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", |
| 43 |
| 44 # debugXML.c compares array 'arg' to NULL. |
| 45 "-Wno-tautological-pointer-compare", |
| 46 |
| 47 # threads.c attempts to forward declare a pthread_equal which doesn't |
| 48 # match the prototype in pthreads.h |
| 49 "-Wno-ignored-attributes", |
| 50 |
| 51 # libxml casts from int to long to void*. |
| 52 "-Wno-int-to-void-pointer-cast", |
| 53 |
| 54 # libxml passes a volatile LPCRITICAL_SECTION* to a function expecting |
| 55 # a void* volatile*. |
| 56 "-Wno-incompatible-pointer-types", |
| 57 |
| 58 # trio_is_special_quantity and trio_is_negative are only |
| 59 # used with certain preprocessor defines set. |
| 60 "-Wno-unused-function", |
| 61 ] |
| 62 } |
| 63 } |
| 64 |
| 27 static_library("libxml") { | 65 static_library("libxml") { |
| 28 output_name = "libxml2" | 66 output_name = "libxml2" |
| 29 sources = [ | 67 sources = [ |
| 30 "chromium/libxml_utils.cc", | 68 "chromium/libxml_utils.cc", |
| 31 "chromium/libxml_utils.h", | 69 "chromium/libxml_utils.h", |
| 32 "linux/config.h", | 70 "linux/config.h", |
| 33 "linux/include/libxml/xmlversion.h", | 71 "linux/include/libxml/xmlversion.h", |
| 34 "mac/config.h", | 72 "mac/config.h", |
| 35 "mac/include/libxml/xmlversion.h", | 73 "mac/include/libxml/xmlversion.h", |
| 36 "src/DOCBparser.c", | 74 "src/DOCBparser.c", |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 "src/xpath.c", | 175 "src/xpath.c", |
| 138 "src/xpointer.c", | 176 "src/xpointer.c", |
| 139 | 177 |
| 140 #"src/xzlib.c", | 178 #"src/xzlib.c", |
| 141 "src/xzlib.h", | 179 "src/xzlib.h", |
| 142 "win32/config.h", | 180 "win32/config.h", |
| 143 "win32/include/libxml/xmlversion.h", | 181 "win32/include/libxml/xmlversion.h", |
| 144 ] | 182 ] |
| 145 | 183 |
| 146 configs -= [ "//build/config/compiler:chromium_code" ] | 184 configs -= [ "//build/config/compiler:chromium_code" ] |
| 147 configs += [ "//build/config/compiler:no_chromium_code" ] | 185 configs += [ |
| 186 "//build/config/compiler:no_chromium_code", |
| 187 |
| 188 # Must be after no_chromium_code for warning flags to be ordered correctly. |
| 189 ":libxml_warnings", |
| 190 ] |
| 148 | 191 |
| 149 public_configs = [ ":libxml_config" ] | 192 public_configs = [ ":libxml_config" ] |
| 150 public_deps = [ | 193 public_deps = [ |
| 151 "//third_party/icu:icuuc", | 194 "//third_party/icu:icuuc", |
| 152 ] | 195 ] |
| 153 deps = [ | 196 deps = [ |
| 154 "//third_party/zlib", | 197 "//third_party/zlib", |
| 155 ] | 198 ] |
| 156 | 199 |
| 157 if (is_win) { | 200 if (is_mac || is_ios || is_android) { |
| 158 cflags_c = [ | |
| 159 "/wd4018", # Signed/unsigned mismatch in comparison. | |
| 160 "/wd4101", # Unreferenced local variable. | |
| 161 ] | |
| 162 } else if (is_mac || is_ios || is_android) { | |
| 163 # http://www.xmlsoft.org/threads.html says that this is required when using | 201 # 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 | 202 # libxml from several threads, which can possibly happen in chrome. On |
| 165 # linux, this is picked up by transitivity from pkg-config output from | 203 # linux, this is picked up by transitivity from pkg-config output from |
| 166 # build/linux/system.gyp. | 204 # build/linux/system.gyp. |
| 167 defines = [ "_REENTRANT" ] | 205 defines = [ "_REENTRANT" ] |
| 168 } | 206 } |
| 169 | 207 |
| 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" ] | 208 include_dirs = [ "$os_include" ] |
| 204 } | 209 } |
| OLD | NEW |