| 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") |
| 6 |
| 5 # 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 |
| 6 # pangoft2 1.31.0 or greater (which pulls it in). | 8 # pangoft2 1.31.0 or greater (which pulls it in). |
| 7 # 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 |
| 8 # 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. |
| 9 # | 11 # |
| 10 # 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 |
| 11 # 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. |
| 12 | 14 |
| 13 declare_args() { | 15 declare_args() { |
| 14 use_system_harfbuzz = is_chromeos | 16 if (is_chromeos) { |
| 17 # ChromeOS includes an up-to-date system harfbuzz that we have control |
| 18 # over, so it use the system one by default. |
| 19 use_system_harfbuzz = true |
| 20 } else if (is_official_build) { |
| 21 # For official builds, we want to control the Harbuzz version so always |
| 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( |
| 32 pkg_config_script, |
| 33 pkg_config_args + [ "--atleast-version=1.31.0", "pangoft2" ], |
| 34 "value") |
| 35 } else { |
| 36 use_system_harfbuzz = false |
| 37 } |
| 15 } | 38 } |
| 16 | 39 |
| 17 if (use_system_harfbuzz) { | 40 if (use_system_harfbuzz) { |
| 18 import("//build/config/linux/pkg_config.gni") | 41 import("//build/config/linux/pkg_config.gni") |
| 19 pkg_config("harfbuzz_pkgconfig") { | 42 pkg_config("harfbuzz_pkgconfig") { |
| 20 packages = [ "harfbuzz" ] | 43 packages = [ "harfbuzz" ] |
| 21 } | 44 } |
| 22 group("harfbuzz-ng") { | 45 group("harfbuzz-ng") { |
| 23 public_configs = [ ":harfbuzz_pkgconfig" ] | 46 public_configs = [ ":harfbuzz_pkgconfig" ] |
| 24 } | 47 } |
| 25 | 48 |
| 26 } else { | 49 } else { |
| 27 config("harfbuzz-ng_config") { | 50 config("harfbuzz-ng_config") { |
| 28 include_dirs = [ "src" ] | 51 include_dirs = [ "src" ] |
| 29 } | 52 } |
| 30 | 53 |
| 31 source_set("harfbuzz-ng") { | 54 static_library("harfbuzz-ng") { |
| 32 sources = [ | 55 sources = [ |
| 33 "src/hb-atomic-private.hh", | 56 "src/hb-atomic-private.hh", |
| 34 "src/hb-blob.cc", | 57 "src/hb-blob.cc", |
| 35 "src/hb-blob.h", | 58 "src/hb-blob.h", |
| 36 "src/hb-buffer.cc", | 59 "src/hb-buffer.cc", |
| 37 "src/hb-buffer-deserialize-json.hh", | 60 "src/hb-buffer-deserialize-json.hh", |
| 38 "src/hb-buffer-deserialize-text.hh", | 61 "src/hb-buffer-deserialize-text.hh", |
| 39 "src/hb-buffer.h", | 62 "src/hb-buffer.h", |
| 40 "src/hb-buffer-private.hh", | 63 "src/hb-buffer-private.hh", |
| 41 "src/hb-buffer-serialize.cc", | 64 "src/hb-buffer-serialize.cc", |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 } | 170 } |
| 148 if (is_mac) { | 171 if (is_mac) { |
| 149 sources += [ | 172 sources += [ |
| 150 "src/hb-coretext.cc", | 173 "src/hb-coretext.cc", |
| 151 "src/hb-coretext.h", | 174 "src/hb-coretext.h", |
| 152 ] | 175 ] |
| 153 defines += [ "HAVE_CORETEXT" ] | 176 defines += [ "HAVE_CORETEXT" ] |
| 154 } | 177 } |
| 155 } | 178 } |
| 156 } | 179 } |
| OLD | NEW |