| 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/chrome_build.gni") | 5 import("//build/config/chrome_build.gni") |
| 6 import("//build/config/linux/pkg_config.gni") | 6 import("//build/config/linux/pkg_config.gni") |
| 7 import("//build/config/ui.gni") | 7 import("//build/config/ui.gni") |
| 8 | 8 |
| 9 # The GYP build supports system harfbuzz for non-official builds when using | 9 # The GYP build supports system harfbuzz for non-official builds when using |
| 10 # pangoft2 1.31.0 or greater (which pulls it in). | 10 # pangoft2 1.31.0 or greater (which pulls it in). |
| 11 # TODO(brettw) we can consider doing this as well, although the benefit is | 11 # TODO(brettw) we can consider doing this as well, although the benefit is |
| 12 # unclear and requires shelling out to a script to check the version. | 12 # unclear and requires shelling out to a script to check the version. |
| 13 # | 13 # |
| 14 # ChromeOS uses an up-to-date system one that we have control over, so we | 14 # ChromeOS uses an up-to-date system one that we have control over, so we |
| 15 # don't want to bloat the binary more by including another copy. | 15 # don't want to bloat the binary more by including another copy. |
| 16 | 16 |
| 17 declare_args() { | 17 declare_args() { |
| 18 # Since version 1.31.0, pangoft2 which we depend on pulls in harfbuzz | 18 # Since version 1.31.0, pangoft2 which we depend on pulls in harfbuzz |
| 19 # anyways. However, we want to have control of the version of harfbuzz | 19 # anyways. However, we want to have control of the version of harfbuzz |
| 20 # we use, so don't use system harfbuzz unless we are building for | 20 # we use, so don't use system harfbuzz unless we are building for |
| 21 # chrome os, where we have the system harfbuzz under control. | 21 # chrome os, where we have the system harfbuzz under control. |
| 22 use_system_harfbuzz = | 22 use_system_harfbuzz = |
| 23 is_linux && is_chromeos && exec_script(pkg_config_script, | 23 is_chromeos_ui && exec_script(pkg_config_script, |
| 24 pkg_config_args + [ | 24 pkg_config_args + [ |
| 25 "--atleast-version=1.31.0", | 25 "--atleast-version=1.31.0", |
| 26 "pangoft2", | 26 "pangoft2", |
| 27 ], | 27 ], |
| 28 "value") | 28 "value") |
| 29 } | 29 } |
| 30 | 30 |
| 31 if (use_system_harfbuzz) { | 31 if (use_system_harfbuzz) { |
| 32 import("//build/config/linux/pkg_config.gni") | 32 import("//build/config/linux/pkg_config.gni") |
| 33 pkg_config("harfbuzz_pkgconfig") { | 33 pkg_config("harfbuzz_pkgconfig") { |
| 34 packages = [ "harfbuzz" ] | 34 packages = [ "harfbuzz" ] |
| 35 } | 35 } |
| 36 group("harfbuzz-ng") { | 36 group("harfbuzz-ng") { |
| 37 public_configs = [ ":harfbuzz_pkgconfig" ] | 37 public_configs = [ ":harfbuzz_pkgconfig" ] |
| 38 } | 38 } |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 "src/hb-coretext.cc", | 177 "src/hb-coretext.cc", |
| 178 "src/hb-coretext.h", | 178 "src/hb-coretext.h", |
| 179 ] | 179 ] |
| 180 defines += [ "HAVE_CORETEXT" ] | 180 defines += [ "HAVE_CORETEXT" ] |
| 181 } | 181 } |
| 182 | 182 |
| 183 # When without -fvisibility=hidden for pango to use the harfbuzz | 183 # When without -fvisibility=hidden for pango to use the harfbuzz |
| 184 # in the tree, all symbols pango needs must be included, or | 184 # in the tree, all symbols pango needs must be included, or |
| 185 # pango uses mixed versions of harfbuzz and leads to crash. | 185 # pango uses mixed versions of harfbuzz and leads to crash. |
| 186 # See crbug.com/462689. | 186 # See crbug.com/462689. |
| 187 if (is_linux && use_pango && !is_chromeos && !is_official_build && | 187 if (is_linux && !is_chromeos_ui && use_pango && !is_official_build && |
| 188 current_cpu != "arm" && current_cpu != "mipsel") { | 188 current_cpu != "arm" && current_cpu != "mipsel") { |
| 189 configs -= [ "//build/config/gcc:symbol_visibility_hidden" ] | 189 configs -= [ "//build/config/gcc:symbol_visibility_hidden" ] |
| 190 configs += [ | 190 configs += [ |
| 191 "//build/config/linux:freetype2", | 191 "//build/config/linux:freetype2", |
| 192 "//build/config/linux:glib", | 192 "//build/config/linux:glib", |
| 193 ] | 193 ] |
| 194 sources += [ | 194 sources += [ |
| 195 "src/hb-ft.cc", | 195 "src/hb-ft.cc", |
| 196 "src/hb-ft.h", | 196 "src/hb-ft.h", |
| 197 "src/hb-glib.cc", | 197 "src/hb-glib.cc", |
| 198 "src/hb-glib.h", | 198 "src/hb-glib.h", |
| 199 ] | 199 ] |
| 200 } | 200 } |
| 201 | 201 |
| 202 # See also chrome/browser/ui/libgtk2ui/BUILD.gn which pulls this. | 202 # See also chrome/browser/ui/libgtk2ui/BUILD.gn which pulls this. |
| 203 config("pangoft2_link_hack") { | 203 config("pangoft2_link_hack") { |
| 204 if (is_linux && use_pango && !is_chromeos && !is_official_build && | 204 if (is_linux && !is_chromeos_ui && use_pango && !is_official_build && |
| 205 current_cpu != "arm" && current_cpu != "mipsel" && | 205 current_cpu != "arm" && current_cpu != "mipsel" && |
| 206 !is_component_build) { | 206 !is_component_build) { |
| 207 # These symbols are referenced from libpangoft2, which will be | 207 # These symbols are referenced from libpangoft2, which will be |
| 208 # dynamically linked later. | 208 # dynamically linked later. |
| 209 ldflags = | 209 ldflags = |
| 210 [ "-Wl,-uhb_ft_face_create_cached,-uhb_glib_get_unicode_funcs" ] | 210 [ "-Wl,-uhb_ft_face_create_cached,-uhb_glib_get_unicode_funcs" ] |
| 211 } | 211 } |
| 212 } | 212 } |
| 213 } | 213 } |
| 214 } | 214 } |
| OLD | NEW |