1 # Copyright 2014 The Chromium Authors
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/buildflag_header.gni")
6 import("//build/config/features.gni")
7 import("//build/config/freetype/freetype.gni")
8 import("//third_party/harfbuzz-ng/harfbuzz.gni")
9 import("//third_party/libjpeg.gni")
13 "This is not used on if blink is not enabled, don't drag it in unintentionally")
15 config("system_libjpeg_config") {
17 defines = [ "USE_SYSTEM_LIBJPEG" ]
20 config("libjpeg_turbo_config") {
21 defines = [ "USE_LIBJPEG_TURBO=1" ]
24 # This is a meta target that forwards to the system's libjpeg,
25 # third_party/libjpeg, or third_party/libjpeg_turbo depending on the build args
26 # declared in this file.
28 if (use_system_libjpeg) {
29 public_configs = [ ":system_libjpeg_config" ]
30 } else if (use_libjpeg_turbo) {
31 public_deps = [ "//third_party/libjpeg_turbo:libjpeg" ]
32 public_configs = [ ":libjpeg_turbo_config" ]
34 public_deps = [ "//third_party/libjpeg:libjpeg" ]
38 # This is a meta target that forwards include paths only to the system's
39 # libjpeg, third_party/libjpeg, or third_party/libjpeg_turbo depending on the
40 # build args declared in this file. This is needed, rarely, for targets that
41 # need to reference libjpeg without explicitly building it.
42 group("jpeg_includes") {
43 if (use_system_libjpeg) {
44 public_configs = [ ":system_libjpeg_config" ]
45 } else if (use_libjpeg_turbo) {
46 public_configs = [ "//third_party/libjpeg_turbo:libjpeg_config" ]
48 public_configs = [ "//third_party/libjpeg:libjpeg_config" ]
52 # FreeType and HarfBuzz libraries are dependent on each other. This component
53 # will depend on the appropriate source sets or export the system packages
54 # for both FreeType and HarfBuzz.
55 component("freetype_harfbuzz") {
58 if (use_system_freetype) {
59 public_configs += [ "//build/linux:freetype_from_pkgconfig" ]
61 public_deps += [ "//third_party/freetype:freetype_source" ]
63 if (use_system_harfbuzz) {
64 public_configs += [ "//third_party/harfbuzz-ng:harfbuzz_from_pkgconfig" ]
66 public_deps += [ "//third_party/harfbuzz-ng:harfbuzz_source" ]
70 buildflag_header("freetype_buildflags") {
71 header = "freetype_buildflags.h"
72 flags = [ "USE_SYSTEM_FREETYPE=$use_system_freetype" ]