OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import("//build/config/linux/pkg_config.gni") | 5 import("//build/config/linux/pkg_config.gni") |
6 | 6 |
7 # The GYP build supports system harfbuzz for non-official builds when using | 7 # The GYP build supports system harfbuzz for non-official builds when using |
8 # pangoft2 1.31.0 or greater (which pulls it in). | 8 # pangoft2 1.31.0 or greater (which pulls it in). |
9 # TODO(brettw) we can consider doing this as well, although the benefit is | 9 # TODO(brettw) we can consider doing this as well, although the benefit is |
10 # unclear and requires shelling out to a script to check the version. | 10 # unclear and requires shelling out to a script to check the version. |
11 # | 11 # |
12 # ChromeOS uses an up-to-date system one that we have control over, so we | 12 # ChromeOS uses an up-to-date system one that we have control over, so we |
13 # don't want to bloat the binary more by including another copy. | 13 # don't want to bloat the binary more by including another copy. |
14 | 14 |
15 declare_args() { | 15 declare_args() { |
16 if (is_chromeos) { | 16 if (is_linux && (!is_official_build || is_chromeos)) { |
17 # ChromeOS includes an up-to-date system harfbuzz that we have control | 17 # Since version 1.31.0, pangoft2 which we depend on pulls in harfbuzz |
18 # over, so it use the system one by default. | 18 # anyways. However, we want to have control of the version of harfbuzz |
19 use_system_harfbuzz = true | 19 # we use, so don't use system harfbuzz for official builds, unless we |
20 } else if (is_official_build) { | 20 # are building for chrome os, where we have the system harfbuzz under |
21 # For official builds, we want to control the Harbuzz version so always | 21 # control as well. |
22 # use our included one. Currently the sysroot includes a version of pangoft | |
23 # that doesn't link to harfbuzz, so there are no linker problems. If we | |
24 # update that version, we'll need to work around the duplicate symbols some | |
25 # other way. | |
26 use_system_harfbuzz = false | |
27 } else if (is_linux) { | |
28 # Use the system harfbuzz for newer versions of pangoft, and not for older | |
29 # ones. pangoft links to the system harfbuzz starting with 1.31.0, which | |
30 # causes duplicate symbols when we link our own version. | |
31 use_system_harfbuzz = exec_script(pkg_config_script, | 22 use_system_harfbuzz = exec_script(pkg_config_script, |
32 pkg_config_args + [ | 23 pkg_config_args + [ |
33 "--atleast-version=1.31.0", | 24 "--atleast-version=1.31.0", |
34 "pangoft2", | 25 "pangoft2", |
35 ], | 26 ], |
36 "value") | 27 "value") |
37 } else { | 28 } else { |
38 use_system_harfbuzz = false | 29 use_system_harfbuzz = false |
39 } | 30 } |
| 31 if (is_linux && cpu_arch == "arm" && !is_chromeos) { |
| 32 # Override use_system_harfbuzz for ARM cross compiling so system |
| 33 # harfbuzz is not used because the corresponding package is not |
| 34 # available. |
| 35 use_system_harfbuzz = false |
| 36 } |
40 } | 37 } |
41 | 38 |
42 if (use_system_harfbuzz) { | 39 if (use_system_harfbuzz) { |
43 import("//build/config/linux/pkg_config.gni") | 40 import("//build/config/linux/pkg_config.gni") |
44 pkg_config("harfbuzz_pkgconfig") { | 41 pkg_config("harfbuzz_pkgconfig") { |
45 packages = [ "harfbuzz" ] | 42 packages = [ "harfbuzz" ] |
46 } | 43 } |
47 group("harfbuzz-ng") { | 44 group("harfbuzz-ng") { |
48 public_configs = [ ":harfbuzz_pkgconfig" ] | 45 public_configs = [ ":harfbuzz_pkgconfig" ] |
49 } | 46 } |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 } | 168 } |
172 if (is_mac) { | 169 if (is_mac) { |
173 sources += [ | 170 sources += [ |
174 "src/hb-coretext.cc", | 171 "src/hb-coretext.cc", |
175 "src/hb-coretext.h", | 172 "src/hb-coretext.h", |
176 ] | 173 ] |
177 defines += [ "HAVE_CORETEXT" ] | 174 defines += [ "HAVE_CORETEXT" ] |
178 } | 175 } |
179 } | 176 } |
180 } | 177 } |
OLD | NEW |