diff --git a/third_party/libxml/BUILD.gn b/third_party/libxml/BUILD.gn index 10d01a999d0e..719953224ff0 100644 --- a/third_party/libxml/BUILD.gn +++ b/third_party/libxml/BUILD.gn @@ -4,6 +4,9 @@ # Define an "os_include" variable that points at the OS-specific generated # headers. These were generated by running the configure script offline. +if (use_cobalt_customizations) { + os_include = "starboard" +} else if (is_linux || is_chromeos || is_android || is_nacl || is_fuchsia) { os_include = "linux" } else if (is_apple) { @@ -66,6 +69,12 @@ config("libxml_warnings") { # TODO(hans): See if we can fix upstream (http://crbug.com/763944). "-Wno-enum-compare", ] + if (is_clang_16 && use_cobalt_customizations) { + cflags += [ + # xmlschemas.c variable 'count' set but not used + "-Wno-unused-but-set-variable", + ] + } } else if (is_linux || is_chromeos) { cflags = [ # gcc spits out a bunch of warnings about passing too many arguments to @@ -75,6 +84,7 @@ config("libxml_warnings") { } } +if (!use_cobalt_customizations) { # exclude libraries "xml_reader" and "xml_writer" static_library("xml_reader") { # Do not expand this visibility list without first consulting with the # Security Team. @@ -111,6 +121,7 @@ static_library("xml_writer") { ] configs += [ ":libxml_config" ] } +} # exclude libraries "xml_reader" and "xml_writer" static_library("libxml_utils") { # Do not expand this visibility list without first consulting with the @@ -144,6 +155,15 @@ static_library("libxml") { "//third_party/libxslt", "//third_party/maldoca/*", ] + if (use_cobalt_customizations) { + visibility += [ + "//base/test:test_support", + "//cobalt/base", + "//cobalt/dom_parser", + "//cobalt/renderer/rasterizer/skia/skia", + "//components/update_client", + ] + } if (is_ios) { foreach(tgt, ios_libxml_visibility_additions) { visibility += [ "//ios_internal/$tgt" ] @@ -275,7 +295,9 @@ static_library("libxml") { "src/xzlib.h", ] +if (!use_cobalt_customizations) { configs -= [ "//build/config/compiler:chromium_code" ] +} configs += [ "//build/config/compiler:no_chromium_code",