diff options
Diffstat (limited to 'chromium/third_party/libxml/BUILD.gn')
-rw-r--r-- | chromium/third_party/libxml/BUILD.gn | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/chromium/third_party/libxml/BUILD.gn b/chromium/third_party/libxml/BUILD.gn index f64fdbc5285..cac8c9260a5 100644 --- a/chromium/third_party/libxml/BUILD.gn +++ b/chromium/third_party/libxml/BUILD.gn @@ -12,6 +12,10 @@ if (is_linux || is_android || is_nacl || is_fuchsia) { os_include = "win32" } +declare_args() { + use_system_libxml = false +} + config("libxml_config") { # Define LIBXML_STATIC as nothing to match how libxml.h (an internal header) # defines LIBXML_STATIC, otherwise we get the macro redefined warning from @@ -73,7 +77,7 @@ config("libxml_warnings") { } } -static_library("libxml") { +static_library("bundled_libxml") { output_name = "libxml2" # Commented out sources are libxml2 files we do not want to include. They are @@ -236,3 +240,22 @@ static_library("libxml") { include_dirs = [ "$os_include" ] } + +if (use_system_libxml) { + import("//build/config/linux/pkg_config.gni") + pkg_config("system_libxml") { + packages = [ "libxml-2.0" ] + } + source_set("libxml") { + sources = [ + "chromium/libxml_utils.cc", + "chromium/libxml_utils.h", + ] + + public_configs = [ ":system_libxml" ] + } +} else { + group("libxml") { + public_deps = [ ":bundled_libxml" ] + } +} |