blob: 7b086f95413ffd0afa4ed0bd8758d2536c6aa019 [file] [log] [blame]
Avi Drissman04c79e102022-10-06 18:59:021# Copyright 2014 The Chromium Authors
[email protected]71eb1122014-05-06 04:25:262# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
Dave Tapuska70065a62023-02-01 21:58:185import("//build/config/features.gni")
Ben Wagner7619f01f2017-10-09 15:35:006import("//build/config/freetype/freetype.gni")
7import("//third_party/harfbuzz-ng/harfbuzz.gni")
Tom Andersonf3d30e92018-03-22 22:30:598import("//third_party/libjpeg.gni")
[email protected]71eb1122014-05-06 04:25:269
Dave Tapuska70065a62023-02-01 21:58:1810assert(
11 use_blink,
12 "This is not used on if blink is not enabled, don't drag it in unintentionally")
thakisf8f88bf2016-08-03 17:34:2513
abakalov62291e732016-08-11 00:56:0114config("system_libjpeg_config") {
15 libs = [ "jpeg" ]
16 defines = [ "USE_SYSTEM_LIBJPEG" ]
17}
18
19config("libjpeg_turbo_config") {
20 defines = [ "USE_LIBJPEG_TURBO=1" ]
21}
22
23# This is a meta target that forwards to the system's libjpeg,
24# third_party/libjpeg, or third_party/libjpeg_turbo depending on the build args
25# declared in this file.
26group("jpeg") {
27 if (use_system_libjpeg) {
28 public_configs = [ ":system_libjpeg_config" ]
29 } else if (use_libjpeg_turbo) {
Nico Weberd7b9b482020-01-15 18:00:1030 public_deps = [ "//third_party/libjpeg_turbo:libjpeg" ]
abakalov62291e732016-08-11 00:56:0131 public_configs = [ ":libjpeg_turbo_config" ]
[email protected]71eb1122014-05-06 04:25:2632 } else {
Nico Weberd7b9b482020-01-15 18:00:1033 public_deps = [ "//third_party/libjpeg:libjpeg" ]
[email protected]71eb1122014-05-06 04:25:2634 }
35}
brucedawsonae9200182017-03-30 21:38:3236
37# This is a meta target that forwards include paths only to the system's
38# libjpeg, third_party/libjpeg, or third_party/libjpeg_turbo depending on the
39# build args declared in this file. This is needed, rarely, for targets that
40# need to reference libjpeg without explicitly building it.
41group("jpeg_includes") {
42 if (use_system_libjpeg) {
43 public_configs = [ ":system_libjpeg_config" ]
44 } else if (use_libjpeg_turbo) {
45 public_configs = [ "//third_party/libjpeg_turbo:libjpeg_config" ]
46 } else {
47 public_configs = [ "//third_party/libjpeg:libjpeg_config" ]
48 }
49}
Ben Wagner7619f01f2017-10-09 15:35:0050
51# FreeType and HarfBuzz libraries are dependent on each other. This component
52# will depend on the appropriate source sets or export the system packages
53# for both FreeType and HarfBuzz.
54component("freetype_harfbuzz") {
55 public_configs = []
56 public_deps = []
57 if (use_system_freetype) {
58 public_configs += [ "//build/linux:freetype_from_pkgconfig" ]
59 } else {
60 public_deps += [ "//third_party/freetype:freetype_source" ]
61 }
62 if (use_system_harfbuzz) {
63 public_configs += [ "//third_party/harfbuzz-ng:harfbuzz_from_pkgconfig" ]
64 } else {
65 public_deps += [ "//third_party/harfbuzz-ng:harfbuzz_source" ]
66 }
67}