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/linux/pkg_config.gni") | 7 import("//build/config/linux/pkg_config.gni") |
7 import("//build/config/ui.gni") | 8 import("//build/config/ui.gni") |
8 import("//testing/libfuzzer/fuzzer_test.gni") | 9 import("//testing/libfuzzer/fuzzer_test.gni") |
9 | 10 |
10 declare_args() { | 11 declare_args() { |
11 # Blink uses a cutting-edge version of Harfbuzz; most Linux distros do not | 12 # Blink uses a cutting-edge version of Harfbuzz; most Linux distros do not |
12 # contain a new enough version of the code to work correctly. However, | 13 # contain a new enough version of the code to work correctly. However, |
13 # ChromeOS chroots (i.e, real ChromeOS builds for devices) do contain a | 14 # ChromeOS chroots (i.e, real ChromeOS builds for devices) do contain a |
14 # new enough version of the library, and so this variable exists so that | 15 # new enough version of the library, and so this variable exists so that |
15 # ChromeOS can build against the system lib and keep binary sizes smaller. | 16 # ChromeOS can build against the system lib and keep binary sizes smaller. |
(...skipping 27 matching lines...) Expand all Loading... | |
43 } | 44 } |
44 if (is_win) { | 45 if (is_win) { |
45 # Result of 32-bit shift implicitly converted to 64 bits. | 46 # Result of 32-bit shift implicitly converted to 64 bits. |
46 cflags += [ "/wd4334" ] | 47 cflags += [ "/wd4334" ] |
47 } | 48 } |
48 } | 49 } |
49 | 50 |
50 # See also chrome/browser/ui/libgtk2ui/BUILD.gn which pulls this. | 51 # See also chrome/browser/ui/libgtk2ui/BUILD.gn which pulls this. |
51 config("pangoft2_link_hack") { | 52 config("pangoft2_link_hack") { |
52 if (is_linux && use_pango && !is_chromeos && !is_official_build && | 53 if (is_linux && use_pango && !is_chromeos && !is_official_build && |
53 current_cpu != "arm" && current_cpu != "mipsel" && !is_component_build) { | 54 current_cpu != "arm" && current_cpu != "mipsel" && |
55 !is_component_build && use_glib) { | |
drott
2016/07/28 07:45:26
Why is use_glib added here? Because pango requires
Mostyn Bramley-Moore
2016/07/28 09:27:14
I added this here because this is dealing with a g
| |
54 # These symbols are referenced from libpangoft2, which will be | 56 # These symbols are referenced from libpangoft2, which will be |
55 # dynamically linked later. | 57 # dynamically linked later. |
56 ldflags = [ "-Wl,-uhb_ft_face_create_cached,-uhb_glib_get_unicode_funcs" ] | 58 ldflags = [ "-Wl,-uhb_ft_face_create_cached,-uhb_glib_get_unicode_funcs" ] |
57 } | 59 } |
58 } | 60 } |
59 | 61 |
60 static_library("harfbuzz-ng") { | 62 static_library("harfbuzz-ng") { |
61 sources = [ | 63 sources = [ |
62 "src/hb-atomic-private.hh", | 64 "src/hb-atomic-private.hh", |
63 "src/hb-blob.cc", | 65 "src/hb-blob.cc", |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
190 | 192 |
191 # When without -fvisibility=hidden for pango to use the harfbuzz | 193 # When without -fvisibility=hidden for pango to use the harfbuzz |
192 # in the tree, all symbols pango needs must be included, or | 194 # in the tree, all symbols pango needs must be included, or |
193 # pango uses mixed versions of harfbuzz and leads to crash. | 195 # pango uses mixed versions of harfbuzz and leads to crash. |
194 # See crbug.com/462689. | 196 # See crbug.com/462689. |
195 if (is_linux && use_pango && !is_chromeos && !is_official_build && | 197 if (is_linux && use_pango && !is_chromeos && !is_official_build && |
196 current_cpu != "arm" && current_cpu != "mipsel") { | 198 current_cpu != "arm" && current_cpu != "mipsel") { |
197 deps += [ "//build/linux:freetype2" ] | 199 deps += [ "//build/linux:freetype2" ] |
198 configs -= [ "//build/config/gcc:symbol_visibility_hidden" ] | 200 configs -= [ "//build/config/gcc:symbol_visibility_hidden" ] |
199 configs += [ "//build/config/gcc:symbol_visibility_default" ] | 201 configs += [ "//build/config/gcc:symbol_visibility_default" ] |
200 configs += [ "//build/config/linux:glib" ] | |
201 sources += [ | 202 sources += [ |
202 "src/hb-ft.cc", | 203 "src/hb-ft.cc", |
203 "src/hb-ft.h", | 204 "src/hb-ft.h", |
205 ] | |
206 } | |
207 if (use_glib) { | |
208 configs += [ "//build/config/linux:glib" ] | |
209 sources += [ | |
204 "src/hb-glib.cc", | 210 "src/hb-glib.cc", |
205 "src/hb-glib.h", | 211 "src/hb-glib.h", |
206 ] | 212 ] |
207 } | 213 } |
208 } | 214 } |
209 } | 215 } |
210 | 216 |
211 fuzzer_test("harfbuzz_fuzzer") { | 217 fuzzer_test("harfbuzz_fuzzer") { |
212 sources = [ | 218 sources = [ |
213 "fuzz/harfbuzz_fuzzer.cc", | 219 "fuzz/harfbuzz_fuzzer.cc", |
214 ] | 220 ] |
215 deps = [ | 221 deps = [ |
216 ":harfbuzz-ng", | 222 ":harfbuzz-ng", |
217 ] | 223 ] |
218 libfuzzer_options = [ "max_len=16800" ] | 224 libfuzzer_options = [ "max_len=16800" ] |
219 seed_corpus = "fuzz/seed_corpus" | 225 seed_corpus = "fuzz/seed_corpus" |
220 } | 226 } |
OLD | NEW |