| 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/features.gni") | 6 import("//build/config/features.gni") |
| 7 import("//build/config/linux/pkg_config.gni") | 7 import("//build/config/linux/pkg_config.gni") |
| 8 import("//build/config/ui.gni") | 8 import("//build/config/ui.gni") |
| 9 import("//testing/libfuzzer/fuzzer_test.gni") | 9 import("//testing/libfuzzer/fuzzer_test.gni") |
| 10 import("//third_party/harfbuzz-ng/harfbuzz.gni") | 10 |
| 11 declare_args() { |
| 12 # Blink uses a cutting-edge version of Harfbuzz; most Linux distros do not |
| 13 # contain a new enough version of the code to work correctly. However, |
| 14 # ChromeOS chroots (i.e, real ChromeOS builds for devices) do contain a |
| 15 # new enough version of the library, and so this variable exists so that |
| 16 # ChromeOS can build against the system lib and keep binary sizes smaller. |
| 17 use_system_harfbuzz = false |
| 18 } |
| 11 | 19 |
| 12 if (use_system_harfbuzz) { | 20 if (use_system_harfbuzz) { |
| 13 import("//build/config/linux/pkg_config.gni") | 21 import("//build/config/linux/pkg_config.gni") |
| 14 pkg_config("harfbuzz_pkgconfig") { | 22 pkg_config("harfbuzz_pkgconfig") { |
| 15 packages = [ "harfbuzz" ] | 23 packages = [ "harfbuzz" ] |
| 16 } | 24 } |
| 17 group("harfbuzz-ng") { | 25 group("harfbuzz-ng") { |
| 18 public_configs = [ ":harfbuzz_pkgconfig" ] | 26 public_configs = [ ":harfbuzz_pkgconfig" ] |
| 19 } | 27 } |
| 20 } else { | 28 } else { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 35 ] | 43 ] |
| 36 } | 44 } |
| 37 if (is_win) { | 45 if (is_win) { |
| 38 # Result of 32-bit shift implicitly converted to 64 bits. | 46 # Result of 32-bit shift implicitly converted to 64 bits. |
| 39 cflags += [ "/wd4334" ] | 47 cflags += [ "/wd4334" ] |
| 40 } | 48 } |
| 41 } | 49 } |
| 42 | 50 |
| 43 # See also chrome/browser/ui/libgtkui/BUILD.gn which pulls this. | 51 # See also chrome/browser/ui/libgtkui/BUILD.gn which pulls this. |
| 44 config("pangoft2_link_hack") { | 52 config("pangoft2_link_hack") { |
| 45 if (is_linux && use_pango && !use_system_harfbuzz && !is_component_build) { | 53 if (is_linux && use_pango && !is_chromeos && !is_official_build && |
| 54 current_cpu != "arm" && current_cpu != "mipsel" && !is_component_build)
{ |
| 46 # These symbols are referenced from libpangoft2, which will be | 55 # These symbols are referenced from libpangoft2, which will be |
| 47 # dynamically linked later. | 56 # dynamically linked later. |
| 48 ldflags = [ "-Wl,-uhb_ft_face_create_cached,-uhb_glib_get_unicode_funcs" ] | 57 ldflags = [ "-Wl,-uhb_ft_face_create_cached,-uhb_glib_get_unicode_funcs" ] |
| 49 } | 58 } |
| 50 } | 59 } |
| 51 | 60 |
| 52 static_library("harfbuzz-ng") { | 61 static_library("harfbuzz-ng") { |
| 53 sources = [ | 62 sources = [ |
| 54 "src/hb-atomic-private.hh", | 63 "src/hb-atomic-private.hh", |
| 55 "src/hb-blob.cc", | 64 "src/hb-blob.cc", |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 "src/hb-coretext.h", | 191 "src/hb-coretext.h", |
| 183 ] | 192 ] |
| 184 defines += [ "HAVE_CORETEXT" ] | 193 defines += [ "HAVE_CORETEXT" ] |
| 185 libs = [ | 194 libs = [ |
| 186 "CoreFoundation.framework", | 195 "CoreFoundation.framework", |
| 187 "CoreGraphics.framework", | 196 "CoreGraphics.framework", |
| 188 "CoreText.framework", | 197 "CoreText.framework", |
| 189 ] | 198 ] |
| 190 } | 199 } |
| 191 | 200 |
| 201 # When without -fvisibility=hidden for pango to use the harfbuzz |
| 202 # in the tree, all symbols pango needs must be included, or |
| 203 # pango uses mixed versions of harfbuzz and leads to crash. |
| 204 # See crbug.com/462689. |
| 205 if (is_linux && use_pango && !is_chromeos && !is_official_build && |
| 206 current_cpu != "arm" && current_cpu != "mipsel") { |
| 207 deps += [ "//build/config/freetype" ] |
| 208 configs -= [ "//build/config/gcc:symbol_visibility_hidden" ] |
| 209 configs += [ "//build/config/gcc:symbol_visibility_default" ] |
| 210 sources += [ |
| 211 "src/hb-ft.cc", |
| 212 "src/hb-ft.h", |
| 213 ] |
| 214 } |
| 192 if (use_glib) { | 215 if (use_glib) { |
| 193 configs += [ "//build/config/linux:glib" ] | 216 configs += [ "//build/config/linux:glib" ] |
| 194 sources += [ | 217 sources += [ |
| 195 "src/hb-glib.cc", | 218 "src/hb-glib.cc", |
| 196 "src/hb-glib.h", | 219 "src/hb-glib.h", |
| 197 ] | 220 ] |
| 198 } | 221 } |
| 199 } | 222 } |
| 200 | |
| 201 static_library("harfbuzz-ng-ft") { | |
| 202 sources = [ | |
| 203 "src/hb-ft.cc", | |
| 204 "src/hb-ft.h", | |
| 205 ] | |
| 206 | |
| 207 if (is_component_build && !is_win) { | |
| 208 configs -= [ "//build/config/gcc:symbol_visibility_hidden" ] | |
| 209 configs += [ "//build/config/gcc:symbol_visibility_default" ] | |
| 210 } | |
| 211 | |
| 212 configs -= [ "//build/config/compiler:chromium_code" ] | |
| 213 configs += [ | |
| 214 "//build/config/compiler:no_chromium_code", | |
| 215 | |
| 216 # Must be after no_chromium_code for warning flags to be ordered | |
| 217 # correctly. | |
| 218 ":harfbuzz_warnings", | |
| 219 ] | |
| 220 public_configs = [ ":harfbuzz-ng_config" ] | |
| 221 | |
| 222 defines = [ | |
| 223 "HAVE_OT", | |
| 224 "HAVE_ICU", | |
| 225 "HAVE_ICU_BUILTIN", | |
| 226 "HB_NO_MT", | |
| 227 ] | |
| 228 | |
| 229 deps = [ | |
| 230 "//third_party/freetype:bootstrap_freetype_for_harfbuzz", | |
| 231 ] | |
| 232 } | |
| 233 } | 223 } |
| 234 | 224 |
| 235 fuzzer_test("harfbuzz_fuzzer") { | 225 fuzzer_test("harfbuzz_fuzzer") { |
| 236 sources = [ | 226 sources = [ |
| 237 "fuzz/harfbuzz_fuzzer.cc", | 227 "fuzz/harfbuzz_fuzzer.cc", |
| 238 ] | 228 ] |
| 239 deps = [ | 229 deps = [ |
| 240 ":harfbuzz-ng", | 230 ":harfbuzz-ng", |
| 241 ] | 231 ] |
| 242 libfuzzer_options = [ "max_len=16800" ] | 232 libfuzzer_options = [ "max_len=16800" ] |
| 243 seed_corpus = "fuzz/seed_corpus" | 233 seed_corpus = "fuzz/seed_corpus" |
| 244 } | 234 } |
| OLD | NEW |