fixup! Upload upstream chromium 85.0.4183.93
[platform/framework/web/chromium-efl.git] / third_party / BUILD.gn
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.
4
5 import("//build/config/freetype/freetype.gni")
6 import("//third_party/harfbuzz-ng/harfbuzz.gni")
7 import("//third_party/libjpeg.gni")
8
9 assert(!is_ios, "This is not used on iOS, don't drag it in unintentionally")
10
11 config("system_libjpeg_config") {
12   libs = [ "jpeg" ]
13   defines = [ "USE_SYSTEM_LIBJPEG" ]
14 }
15
16 config("libjpeg_turbo_config") {
17   defines = [ "USE_LIBJPEG_TURBO=1" ]
18 }
19
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.
23 group("jpeg") {
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" ]
29   } else {
30     public_deps = [ "//third_party/libjpeg:libjpeg" ]
31   }
32 }
33
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" ]
43   } else {
44     public_configs = [ "//third_party/libjpeg:libjpeg_config" ]
45   }
46 }
47
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") {
52   public_configs = []
53   public_deps = []
54   if (use_system_freetype) {
55     public_configs += [ "//build/linux:freetype_from_pkgconfig" ]
56   } else {
57     public_deps += [ "//third_party/freetype:freetype_source" ]
58   }
59   if (use_system_harfbuzz) {
60     public_configs += [ "//third_party/harfbuzz-ng:harfbuzz_from_pkgconfig" ]
61   } else {
62     public_deps += [ "//third_party/harfbuzz-ng:harfbuzz_source" ]
63   }
64 }