From a9a20127e8adeb3f3cd7921b0bec32083103cc5c Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Mon, 23 Sep 2019 10:12:09 +0200 Subject: Improve jpeg headers handling Add pkg-config support to libjpeg. Add shim support, it seems that some features from pdfium are using libjpeg.h. This is re-uploaded from 73-based. Task-number: QTBUG-77827 Change-Id: I671f16899e86057a83efdb48332cbf496da39788 Reviewed-by: Allan Sandfeld Jensen --- chromium/third_party/BUILD.gn | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/chromium/third_party/BUILD.gn b/chromium/third_party/BUILD.gn index 3c14675691f..41bcc6d0aa9 100644 --- a/chromium/third_party/BUILD.gn +++ b/chromium/third_party/BUILD.gn @@ -11,8 +11,27 @@ if (!use_qt) { assert(!is_ios, "This is not used on iOS, don't drag it in unintentionally") } +if (use_system_libjpeg) { + import("//build/config/linux/pkg_config.gni") + import("//build/shim_headers.gni") + pkg_config("system_libjpeg") { + packages = [ "libjpeg" ] + } + shim_headers("libjpeg_shim") { + root_path = "libjpeg" + headers = [ + "jpeglib.h" + ] + } + source_set("libjpeg") { + deps = [ ":libjpeg_shim" ] + public_configs = [ ":system_libjpeg", + ":system_libjpeg_config" + ] + } +} + config("system_libjpeg_config") { - libs = [ "jpeg" ] defines = [ "USE_SYSTEM_LIBJPEG" ] } @@ -25,7 +44,7 @@ config("libjpeg_turbo_config") { # declared in this file. group("jpeg") { if (use_system_libjpeg) { - public_configs = [ ":system_libjpeg_config" ] + public_deps = [ ":libjpeg" ] } else if (use_libjpeg_turbo) { public_deps = [ "//third_party/libjpeg_turbo:libjpeg", @@ -44,7 +63,7 @@ group("jpeg") { # need to reference libjpeg without explicitly building it. group("jpeg_includes") { if (use_system_libjpeg) { - public_configs = [ ":system_libjpeg_config" ] + public_configs = [ ":system_libjpeg_config", ":system_libjpeg" ] } else if (use_libjpeg_turbo) { public_configs = [ "//third_party/libjpeg_turbo:libjpeg_config" ] } else { -- cgit v1.2.1