commit | cba9a3c1dbed71e0c1d0aa677bb648952ad71c90 | [log] [tgz] |
---|---|---|
author | Lei Zhang <thestig@chromium.org> | Wed Nov 15 20:48:56 2023 +0000 |
committer | Pdfium LUCI CQ <pdfium-scoped@luci-project-accounts.iam.gserviceaccount.com> | Wed Nov 15 20:48:56 2023 +0000 |
tree | 49d8f978502719ac4b92b012ca28cb6e3bf31254 | |
parent | fa80feef8f4f8ed3bcfba5d07d3eec92106e26f6 [diff] |
Properly support the use_system_libtiff GN build option The changes in https://pdfium-review.googlesource.com/105650 were not sufficient, as it still relied on //third_party/libtiff headers. Change the C++ code to use the system libtiff header when appropriate, similar to how use_system_libpng is implemented. Bug: chromium:1501495 Change-Id: I194ef66ba02067222a55630259151f247bae9ecf Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/113595 Reviewed-by: Nigi <nigi@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fxcodec/tiff/tiff_decoder.cpp b/core/fxcodec/tiff/tiff_decoder.cpp index 928b7eb..a26f7b8 100644 --- a/core/fxcodec/tiff/tiff_decoder.cpp +++ b/core/fxcodec/tiff/tiff_decoder.cpp
@@ -23,7 +23,11 @@ #include "third_party/base/numerics/safe_conversions.h" extern "C" { +#if defined(USE_SYSTEM_LIBTIFF) +#include <tiffio.h> +#else #include "third_party/libtiff/tiffio.h" +#endif } // extern C namespace {
diff --git a/third_party/BUILD.gn b/third_party/BUILD.gn index bf12e49..04ad71d 100644 --- a/third_party/BUILD.gn +++ b/third_party/BUILD.gn
@@ -457,6 +457,7 @@ if (use_system_libtiff) { config("system_tiff_config") { libs = [ "tiff" ] + defines = [ "USE_SYSTEM_LIBTIFF" ] } } else { source_set("fx_tiff") {