diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-05-06 01:54:54 +0200 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-05-06 00:44:31 +0000 |
commit | 2df760fea931b546d290e797b8c216530c4e13c1 (patch) | |
tree | 9498a2ab46645444c17c6890f13713e04db12225 /third_party/BUILD.gn | |
parent | 332ef5423df9aa7a28166907f4a6ac8ac095163d (diff) | |
download | pdfium-2df760fea931b546d290e797b8c216530c4e13c1.tar.xz |
core: allow building against system zlib
In a way similar to the existing USE_SYSTEM_LIBJPEG. The default is of
course still the DEPS-based zlib checkout.
Changes in v2:
1) Since Chromium doesn't have //third_party:zlib (AKA a "zlib" target in
//third_party/BUILD.GN) all the targets that depended on //third_party:zlib now
depend on third_party:zlib, which always points to PDFium's
third_party/BUILD.GN. The targets that depended on //third_party:zlib in
third_party/BUILD.GN just depend on :zlib instead.
2) Move the zlib bits out of !build_with_chromium block.
Change-Id: Id73eb07591418ff2ae71b83b87c18af71b49a22a
Reviewed-on: https://pdfium-review.googlesource.com/5030
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'third_party/BUILD.gn')
-rw-r--r-- | third_party/BUILD.gn | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/third_party/BUILD.gn b/third_party/BUILD.gn index 7730212c75..4e12741f69 100644 --- a/third_party/BUILD.gn +++ b/third_party/BUILD.gn @@ -321,6 +321,21 @@ if (!build_with_chromium) { } } +config("system_zlib_config") { + libs = [ "z" ] + defines = [ "USE_SYSTEM_ZLIB" ] +} + +group("zlib") { + if (use_system_zlib) { + public_configs = [ ":system_zlib_config" ] + } else { + public_deps = [ + "//third_party/zlib", + ] + } +} + config("fx_libopenjpeg_warnings") { visibility = [ ":*" ] if (is_win) { @@ -398,7 +413,7 @@ static_library("fx_lpng") { defines = [] cflags = [] deps = [ - "//third_party/zlib", + ":zlib", ] if (current_cpu == "x86" || current_cpu == "x64") { @@ -437,8 +452,8 @@ if (pdf_enable_xfa) { configs -= [ "//build/config/win:lean_and_mean" ] } deps = [ + ":zlib", "//third_party:jpeg", - "//third_party/zlib", ] sources = [ "libtiff/tif_aux.c", |