1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 import("//build/config/freetype/freetype.gni")
6 import("//third_party/harfbuzz-ng/harfbuzz.gni")
7 import("//third_party/libjpeg.gni")
9 assert(!is_ios, "This is not used on iOS, don't drag it in unintentionally")
11 config("system_libjpeg_config") {
13 defines = [ "USE_SYSTEM_LIBJPEG" ]
16 config("libjpeg_turbo_config") {
17 defines = [ "USE_LIBJPEG_TURBO=1" ]
20 # This is a meta target that forwards to the system's libjpeg,
21 # third_party/libjpeg, or third_party/libjpeg_turbo depending on the build args
22 # declared in this file.
24 if (use_system_libjpeg) {
25 public_configs = [ ":system_libjpeg_config" ]
26 } else if (use_libjpeg_turbo) {
27 public_deps = [ "//third_party/libjpeg_turbo:libjpeg" ]
28 public_configs = [ ":libjpeg_turbo_config" ]
30 public_deps = [ "//third_party/libjpeg:libjpeg" ]
34 # This is a meta target that forwards include paths only to the system's
35 # libjpeg, third_party/libjpeg, or third_party/libjpeg_turbo depending on the
36 # build args declared in this file. This is needed, rarely, for targets that
37 # need to reference libjpeg without explicitly building it.
38 group("jpeg_includes") {
39 if (use_system_libjpeg) {
40 public_configs = [ ":system_libjpeg_config" ]
41 } else if (use_libjpeg_turbo) {
42 public_configs = [ "//third_party/libjpeg_turbo:libjpeg_config" ]
44 public_configs = [ "//third_party/libjpeg:libjpeg_config" ]
48 # FreeType and HarfBuzz libraries are dependent on each other. This component
49 # will depend on the appropriate source sets or export the system packages
50 # for both FreeType and HarfBuzz.
51 component("freetype_harfbuzz") {
54 if (use_system_freetype) {
55 public_configs += [ "//build/linux:freetype_from_pkgconfig" ]
57 public_deps += [ "//third_party/freetype:freetype_source" ]
59 if (use_system_harfbuzz) {
60 public_configs += [ "//third_party/harfbuzz-ng:harfbuzz_from_pkgconfig" ]
62 public_deps += [ "//third_party/harfbuzz-ng:harfbuzz_source" ]