summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chromium/third_party/BUILD.gn25
1 files 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 {