Avi Drissman | 04c79e10 | 2022-10-06 18:59:02 | [diff] [blame] | 1 | # Copyright 2014 The Chromium Authors |
[email protected] | 71eb112 | 2014-05-06 04:25:26 | [diff] [blame] | 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
Dave Tapuska | 70065a6 | 2023-02-01 21:58:18 | [diff] [blame] | 5 | import("//build/config/features.gni") |
Ben Wagner | 7619f01f | 2017-10-09 15:35:00 | [diff] [blame] | 6 | import("//build/config/freetype/freetype.gni") |
| 7 | import("//third_party/harfbuzz-ng/harfbuzz.gni") |
Tom Anderson | f3d30e9 | 2018-03-22 22:30:59 | [diff] [blame] | 8 | import("//third_party/libjpeg.gni") |
[email protected] | 71eb112 | 2014-05-06 04:25:26 | [diff] [blame] | 9 | |
Dave Tapuska | 70065a6 | 2023-02-01 21:58:18 | [diff] [blame] | 10 | assert( |
| 11 | use_blink, |
| 12 | "This is not used on if blink is not enabled, don't drag it in unintentionally") |
thakis | f8f88bf | 2016-08-03 17:34:25 | [diff] [blame] | 13 | |
abakalov | 62291e73 | 2016-08-11 00:56:01 | [diff] [blame] | 14 | config("system_libjpeg_config") { |
| 15 | libs = [ "jpeg" ] |
| 16 | defines = [ "USE_SYSTEM_LIBJPEG" ] |
| 17 | } |
| 18 | |
| 19 | config("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. |
| 26 | group("jpeg") { |
| 27 | if (use_system_libjpeg) { |
| 28 | public_configs = [ ":system_libjpeg_config" ] |
| 29 | } else if (use_libjpeg_turbo) { |
Nico Weber | d7b9b48 | 2020-01-15 18:00:10 | [diff] [blame] | 30 | public_deps = [ "//third_party/libjpeg_turbo:libjpeg" ] |
abakalov | 62291e73 | 2016-08-11 00:56:01 | [diff] [blame] | 31 | public_configs = [ ":libjpeg_turbo_config" ] |
[email protected] | 71eb112 | 2014-05-06 04:25:26 | [diff] [blame] | 32 | } else { |
Nico Weber | d7b9b48 | 2020-01-15 18:00:10 | [diff] [blame] | 33 | public_deps = [ "//third_party/libjpeg:libjpeg" ] |
[email protected] | 71eb112 | 2014-05-06 04:25:26 | [diff] [blame] | 34 | } |
| 35 | } |
brucedawson | ae920018 | 2017-03-30 21:38:32 | [diff] [blame] | 36 | |
| 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. |
| 41 | group("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 Wagner | 7619f01f | 2017-10-09 15:35:00 | [diff] [blame] | 50 | |
| 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. |
| 54 | component("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 | } |