| 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 import("//third_party/harfbuzz-ng/harfbuzz.gni") |
| 8 | 9 |
| 9 # The GYP build supports system harfbuzz for non-official builds when using | 10 # The GYP build supports system harfbuzz for non-official builds when using |
| 10 # pangoft2 1.31.0 or greater (which pulls it in). | 11 # pangoft2 1.31.0 or greater (which pulls it in). |
| 11 # TODO(brettw) we can consider doing this as well, although the benefit is | 12 # 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. | 13 # unclear and requires shelling out to a script to check the version. |
| 13 # | 14 # |
| 14 # ChromeOS uses an up-to-date system one that we have control over, so we | 15 # 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. | 16 # don't want to bloat the binary more by including another copy. |
| 16 | 17 |
| 17 declare_args() { | 18 declare_args() { |
| 18 # Since version 1.31.0, pangoft2 which we depend on pulls in harfbuzz | 19 # 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 | 20 # 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 | 21 # we use, so don't use system harfbuzz unless we are building for |
| 21 # chrome os, where we have the system harfbuzz under control. | 22 # chrome os, where we have the system harfbuzz under control. |
| 22 use_system_harfbuzz = | 23 use_system_harfbuzz = false |
| 23 is_linux && is_chromeos && exec_script(pkg_config_script, | 24 # is_linux && is_chromeos && exec_script(pkg_config_script, |
| 24 pkg_config_args + [ | 25 # pkg_config_args + [ |
| 25 "--atleast-version=1.31.0", | 26 # "--atleast-version=1.31.0"
, |
| 26 "pangoft2", | 27 # "pangoft2", |
| 27 ], | 28 # ], |
| 28 "value") | 29 # "value") |
| 29 } | 30 } |
| 30 | 31 |
| 31 if (use_system_harfbuzz) { | 32 if (use_system_harfbuzz) { |
| 32 import("//build/config/linux/pkg_config.gni") | 33 import("//build/config/linux/pkg_config.gni") |
| 33 pkg_config("harfbuzz_pkgconfig") { | 34 pkg_config("harfbuzz_pkgconfig") { |
| 34 packages = [ "harfbuzz" ] | 35 packages = [ "harfbuzz" ] |
| 35 } | 36 } |
| 36 group("harfbuzz-ng") { | 37 group("harfbuzz-ng") { |
| 37 public_configs = [ ":harfbuzz_pkgconfig" ] | 38 public_configs = [ ":harfbuzz_pkgconfig" ] |
| 38 } | 39 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 62 # See also chrome/browser/ui/libgtk2ui/BUILD.gn which pulls this. | 63 # See also chrome/browser/ui/libgtk2ui/BUILD.gn which pulls this. |
| 63 config("pangoft2_link_hack") { | 64 config("pangoft2_link_hack") { |
| 64 if (is_linux && use_pango && !is_chromeos && !is_official_build && | 65 if (is_linux && use_pango && !is_chromeos && !is_official_build && |
| 65 current_cpu != "arm" && current_cpu != "mipsel" && !is_component_build)
{ | 66 current_cpu != "arm" && current_cpu != "mipsel" && !is_component_build)
{ |
| 66 # These symbols are referenced from libpangoft2, which will be | 67 # These symbols are referenced from libpangoft2, which will be |
| 67 # dynamically linked later. | 68 # dynamically linked later. |
| 68 ldflags = [ "-Wl,-uhb_ft_face_create_cached,-uhb_glib_get_unicode_funcs" ] | 69 ldflags = [ "-Wl,-uhb_ft_face_create_cached,-uhb_glib_get_unicode_funcs" ] |
| 69 } | 70 } |
| 70 } | 71 } |
| 71 | 72 |
| 72 static_library("harfbuzz-ng") { | 73 harfbuzz_defines = [ |
| 73 sources = [ | 74 "HAVE_OT", |
| 74 "src/hb-atomic-private.hh", | 75 "HAVE_ICU", |
| 75 "src/hb-blob.cc", | 76 "HAVE_ICU_BUILTIN", |
| 76 "src/hb-blob.h", | 77 "HB_NO_MT", |
| 77 "src/hb-buffer-deserialize-json.hh", | 78 ] |
| 78 "src/hb-buffer-deserialize-text.hh", | |
| 79 "src/hb-buffer-private.hh", | |
| 80 "src/hb-buffer-serialize.cc", | |
| 81 "src/hb-buffer.cc", | |
| 82 "src/hb-buffer.h", | |
| 83 "src/hb-cache-private.hh", | |
| 84 "src/hb-common.cc", | |
| 85 "src/hb-common.h", | |
| 86 "src/hb-deprecated.h", | |
| 87 "src/hb-face-private.hh", | |
| 88 "src/hb-face.cc", | |
| 89 "src/hb-face.h", | |
| 90 "src/hb-fallback-shape.cc", | |
| 91 "src/hb-font-private.hh", | |
| 92 "src/hb-font.cc", | |
| 93 "src/hb-font.h", | |
| 94 "src/hb-icu.cc", | |
| 95 "src/hb-icu.h", | |
| 96 "src/hb-mutex-private.hh", | |
| 97 "src/hb-object-private.hh", | |
| 98 "src/hb-open-file-private.hh", | |
| 99 "src/hb-open-type-private.hh", | |
| 100 "src/hb-ot-font.cc", | |
| 101 "src/hb-ot-font.h", | |
| 102 "src/hb-ot-head-table.hh", | |
| 103 "src/hb-ot-hhea-table.hh", | |
| 104 "src/hb-ot-hmtx-table.hh", | |
| 105 "src/hb-ot-layout-common-private.hh", | |
| 106 "src/hb-ot-layout-gdef-table.hh", | |
| 107 "src/hb-ot-layout-gpos-table.hh", | |
| 108 "src/hb-ot-layout-gsub-table.hh", | |
| 109 "src/hb-ot-layout-gsubgpos-private.hh", | |
| 110 "src/hb-ot-layout-private.hh", | |
| 111 "src/hb-ot-layout.cc", | |
| 112 "src/hb-ot-layout.h", | |
| 113 "src/hb-ot-map-private.hh", | |
| 114 "src/hb-ot-map.cc", | |
| 115 "src/hb-ot-maxp-table.hh", | |
| 116 "src/hb-ot-name-table.hh", | |
| 117 "src/hb-ot-shape-complex-arabic-fallback.hh", | |
| 118 "src/hb-ot-shape-complex-arabic-private.hh", | |
| 119 "src/hb-ot-shape-complex-arabic-table.hh", | |
| 120 "src/hb-ot-shape-complex-arabic.cc", | |
| 121 "src/hb-ot-shape-complex-default.cc", | |
| 122 "src/hb-ot-shape-complex-hangul.cc", | |
| 123 "src/hb-ot-shape-complex-hebrew.cc", | |
| 124 "src/hb-ot-shape-complex-indic-machine.hh", | |
| 125 "src/hb-ot-shape-complex-indic-private.hh", | |
| 126 "src/hb-ot-shape-complex-indic-table.cc", | |
| 127 "src/hb-ot-shape-complex-indic.cc", | |
| 128 "src/hb-ot-shape-complex-myanmar-machine.hh", | |
| 129 "src/hb-ot-shape-complex-myanmar.cc", | |
| 130 "src/hb-ot-shape-complex-private.hh", | |
| 131 "src/hb-ot-shape-complex-thai.cc", | |
| 132 "src/hb-ot-shape-complex-tibetan.cc", | |
| 133 "src/hb-ot-shape-complex-use-machine.hh", | |
| 134 "src/hb-ot-shape-complex-use-private.hh", | |
| 135 "src/hb-ot-shape-complex-use-table.cc", | |
| 136 "src/hb-ot-shape-complex-use.cc", | |
| 137 "src/hb-ot-shape-fallback-private.hh", | |
| 138 "src/hb-ot-shape-fallback.cc", | |
| 139 "src/hb-ot-shape-normalize-private.hh", | |
| 140 "src/hb-ot-shape-normalize.cc", | |
| 141 "src/hb-ot-shape-private.hh", | |
| 142 "src/hb-ot-shape.cc", | |
| 143 "src/hb-ot-shape.h", | |
| 144 "src/hb-ot-tag.cc", | |
| 145 "src/hb-ot-tag.h", | |
| 146 "src/hb-ot.h", | |
| 147 "src/hb-private.hh", | |
| 148 "src/hb-set-private.hh", | |
| 149 "src/hb-set.cc", | |
| 150 "src/hb-set.h", | |
| 151 "src/hb-shape-plan-private.hh", | |
| 152 "src/hb-shape-plan.cc", | |
| 153 "src/hb-shape-plan.h", | |
| 154 "src/hb-shape.cc", | |
| 155 "src/hb-shape.h", | |
| 156 "src/hb-shaper-impl-private.hh", | |
| 157 "src/hb-shaper-list.hh", | |
| 158 "src/hb-shaper-private.hh", | |
| 159 "src/hb-shaper.cc", | |
| 160 "src/hb-unicode-private.hh", | |
| 161 "src/hb-unicode.cc", | |
| 162 "src/hb-unicode.h", | |
| 163 "src/hb-utf-private.hh", | |
| 164 "src/hb-version.h", | |
| 165 "src/hb-warning.cc", | |
| 166 "src/hb.h", | |
| 167 ] | |
| 168 | 79 |
| 169 defines = [ | 80 if (is_linux && is_chromeos) { |
| 170 "HAVE_OT", | 81 loadable_module("harfbuzz-ng") { |
| 171 "HAVE_ICU", | 82 output_name = "harfbuzz" |
| 172 "HAVE_ICU_BUILTIN", | 83 output_extension = "so" |
| 173 "HB_NO_MT", | |
| 174 ] | |
| 175 | 84 |
| 176 configs -= [ "//build/config/compiler:chromium_code" ] | 85 sources = harfbuzz_files |
| 177 configs += [ | |
| 178 "//build/config/compiler:no_chromium_code", | |
| 179 | 86 |
| 180 # Must be after no_chromium_code for warning flags to be ordered | 87 defines = harfbuzz_defines |
| 181 # correctly. | |
| 182 ":harfbuzz_warnings", | |
| 183 ] | |
| 184 public_configs = [ ":harfbuzz-ng_config" ] | |
| 185 | 88 |
| 186 deps = [ | 89 configs -= [ "//build/config/compiler:chromium_code" ] |
| 187 "//third_party/icu:icuuc", | 90 configs += [ |
| 188 ] | 91 "//build/config/compiler:no_chromium_code", |
| 189 | 92 |
| 190 if (is_mac) { | 93 # Must be after no_chromium_code for warning flags to be ordered |
| 191 sources += [ | 94 # correctly. |
| 192 "src/hb-coretext.cc", | 95 ":harfbuzz_warnings", |
| 193 "src/hb-coretext.h", | |
| 194 ] | 96 ] |
| 195 defines += [ "HAVE_CORETEXT" ] | 97 |
| 98 public_configs = [ ":harfbuzz-ng_config" ] |
| 99 |
| 100 deps = [ |
| 101 "//third_party/icu:icuuc", |
| 102 ] |
| 196 } | 103 } |
| 104 } else { |
| 105 static_library("harfbuzz-ng") { |
| 106 sources = harfbuzz_files |
| 197 | 107 |
| 198 # When without -fvisibility=hidden for pango to use the harfbuzz | 108 defines = harfbuzz_defines |
| 199 # in the tree, all symbols pango needs must be included, or | 109 |
| 200 # pango uses mixed versions of harfbuzz and leads to crash. | 110 configs -= [ "//build/config/compiler:chromium_code" ] |
| 201 # See crbug.com/462689. | 111 configs += [ |
| 202 if (is_linux && use_pango && !is_chromeos && !is_official_build && | 112 "//build/config/compiler:no_chromium_code", |
| 203 current_cpu != "arm" && current_cpu != "mipsel") { | 113 |
| 204 deps += [ "//build/linux:freetype2" ] | 114 # Must be after no_chromium_code for warning flags to be ordered |
| 205 configs -= [ "//build/config/gcc:symbol_visibility_hidden" ] | 115 # correctly. |
| 206 configs += [ "//build/config/linux:glib" ] | 116 ":harfbuzz_warnings", |
| 207 sources += [ | |
| 208 "src/hb-ft.cc", | |
| 209 "src/hb-ft.h", | |
| 210 "src/hb-glib.cc", | |
| 211 "src/hb-glib.h", | |
| 212 ] | 117 ] |
| 118 public_configs = [ ":harfbuzz-ng_config" ] |
| 119 |
| 120 deps = [ |
| 121 "//third_party/icu:icuuc", |
| 122 ] |
| 123 |
| 124 if (is_mac) { |
| 125 sources += [ |
| 126 "src/hb-coretext.cc", |
| 127 "src/hb-coretext.h", |
| 128 ] |
| 129 defines += [ "HAVE_CORETEXT" ] |
| 130 } |
| 131 |
| 132 # When without -fvisibility=hidden for pango to use the harfbuzz |
| 133 # in the tree, all symbols pango needs must be included, or |
| 134 # pango uses mixed versions of harfbuzz and leads to crash. |
| 135 # See crbug.com/462689. |
| 136 if (is_linux && use_pango && !is_chromeos && !is_official_build && |
| 137 current_cpu != "arm" && current_cpu != "mipsel") { |
| 138 deps += [ "//build/linux:freetype2" ] |
| 139 configs -= [ "//build/config/gcc:symbol_visibility_hidden" ] |
| 140 configs += [ "//build/config/linux:glib" ] |
| 141 sources += [ |
| 142 "src/hb-ft.cc", |
| 143 "src/hb-ft.h", |
| 144 "src/hb-glib.cc", |
| 145 "src/hb-glib.h", |
| 146 ] |
| 147 } |
| 213 } | 148 } |
| 214 } | 149 } |
| 215 } | 150 } |
| OLD | NEW |