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
3 # found in the LICENSE file.
5 import("//build/config/ui.gni")
6 import("//third_party/WebKit/Source/build/scripts/scripts.gni")
7 import("//third_party/WebKit/Source/config.gni")
8 import("//third_party/WebKit/Source/platform/platform.gni")
9 import("//third_party/WebKit/Source/platform/platform_generated.gni")
10 import("//third_party/yasm/yasm_assemble.gni")
12 # Most targets in this file are private actions so use that as the default.
15 heap_gypi = exec_script(
16 "//build/gypi_to_gn.py",
17 [ rebase_path("heap/blink_heap.gypi") ],
19 [ "heap/blink_heap.gypi" ])
21 blink_platform_neon_files = [
22 "graphics/cpu/arm/WebGLImageConversionNEON.h",
23 "graphics/cpu/arm/filters/FEBlendNEON.h",
24 "graphics/cpu/arm/filters/FECompositeArithmeticNEON.h",
25 "graphics/cpu/arm/filters/FEGaussianBlurNEON.h",
26 "graphics/cpu/arm/filters/NEONHelpers.h",
29 # blink_common in blink_platform.gyp
30 component("blink_common") {
31 visibility = "//third_party/WebKit/*"
33 "exported/WebCString.cpp",
34 "exported/WebString.cpp",
35 "exported/WebCommon.cpp",
39 "BLINK_COMMON_IMPLEMENTATION=1",
44 "//build/config/compiler:wexit_time_destructors",
45 "//third_party/WebKit/Source:config",
46 "//third_party/WebKit/Source:non_test_config",
50 "//third_party/WebKit/Source/wtf",
54 # Chromium's version of WebCore includes the following Objective-C classes. The
55 # system-provided WebCore framework may also provide these classes. Because of
56 # the nature of Objective-C binding (dynamically at runtime), it's possible for
57 # the Chromium-provided versions to interfere with the system-provided
58 # versions. This may happen when a system framework attempts to use
59 # core.framework, such as when converting an HTML-flavored string to an
60 # NSAttributedString. The solution is to force Objective-C class names that
61 # would conflict to use alternate names.
63 # This list will hopefully shrink but may also grow. Its performance is
64 # monitored by the "Check Objective-C Rename" postbuild step, and any
65 # suspicious-looking symbols not handled here or whitelisted in that step will
66 # cause a build failure.
68 # If this is unhandled, the console will receive log messages
70 # com.google.Chrome[] objc[]: Class ScrollbarPrefsObserver is implemented in both .../Google Chrome.app/Contents/Versions/.../Google Chrome Helper.app/Contents/MacOS/../../../Google Chrome Framework.framework/Google Chrome Framework and /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/WebCore. One of the two will be used. Which one is undefined.
72 config("mac_objc_renaming") {
74 "WebCascadeList=ChromiumWebCoreObjCWebCascadeList",
75 "WebFontCache=ChromiumWebCoreObjCWebFontCache",
76 "WebScrollAnimationHelperDelegate=ChromiumWebCoreObjCWebScrollAnimationHelperDelegate",
77 "WebScrollbarPainterControllerDelegate=ChromiumWebCoreObjCWebScrollbarPainterControllerDelegate",
78 "WebScrollbarPainterDelegate=ChromiumWebCoreObjCWebScrollbarPainterDelegate",
79 "WebScrollbarPartAnimation=ChromiumWebCoreObjCWebScrollbarPartAnimation",
80 "WebCoreFlippedView=ChromiumWebCoreObjCWebCoreFlippedView",
81 "WebCoreTextFieldCell=ChromiumWebCoreObjCWebCoreTextFieldCell",
82 "WebCoreRenderThemeNotificationObserver=ChromiumWebCoreObjCWebCoreRenderThemeNotificationObserver",
87 # FontFamilyNames action in make_platform_generated in
88 # platform_generated.gyp
89 action("font_family_names") {
90 script = "../build/scripts/make_names.py"
92 font_family_names_in = "fonts/FontFamilyNames.in"
93 inputs = make_names_files + [ font_family_names_in ]
96 "$blink_platform_output_dir/FontFamilyNames.cpp",
97 "$blink_platform_output_dir/FontFamilyNames.h",
101 rebase_path(font_family_names_in, root_build_dir),
103 rebase_path(blink_platform_output_dir, root_build_dir),
107 # RuntimeEnabledFeatures action in make_platform_generated in
108 # platform_generated.gyp
109 action("runtime_enabled_features") {
110 script = "../build/scripts/make_runtime_features.py"
112 runtime_enabled_features_in = "RuntimeEnabledFeatures.in"
113 inputs = scripts_for_in_files + [
114 runtime_enabled_features_in,
115 "../build/scripts/templates/RuntimeEnabledFeatures.cpp.tmpl",
116 "../build/scripts/templates/RuntimeEnabledFeatures.h.tmpl",
120 "$blink_platform_output_dir/RuntimeEnabledFeatures.cpp",
121 "$blink_platform_output_dir/RuntimeEnabledFeatures.h",
125 rebase_path(runtime_enabled_features_in, root_build_dir),
127 rebase_path(blink_platform_output_dir, root_build_dir),
131 # ColorData action in make_platform_generated in platform_generated.gyp
132 action("color_data") {
133 script = "../build/scripts/gperf.py"
135 color_data_gperf = "ColorData.gperf"
136 inputs = [ color_data_gperf ]
138 output_file = "$blink_platform_output_dir/ColorData.cpp"
139 outputs = [ output_file ]
145 rebase_path(color_data_gperf, root_build_dir),
146 "--output-file=" + rebase_path(output_file, root_build_dir),
150 # This isn't strictly necessary since we can just add the deps to "platform",
151 # but it helps to have the targets match the GYP build.
152 group("make_platform_generated") {
153 visibility = "//third_party/WebKit/Source/*"
157 ":font_family_names",
158 ":runtime_enabled_features",
162 # TODO(brettw) Objective C Renaming postbuild steps on Mac.
163 # blink_platform target in blink_platform.gyp
164 component("platform") {
165 visibility = "//third_party/WebKit/*"
166 output_name = "blink_platform"
168 sources = platform_files
169 sources -= blink_platform_neon_files
171 # Add in the generated files.
173 get_target_outputs(":font_family_names") +
174 get_target_outputs(":runtime_enabled_features") +
175 get_target_outputs(":color_data")
178 "//third_party/WebKit/Source:config",
179 "//third_party/WebKit/Source:non_test_config",
183 "BLINK_PLATFORM_IMPLEMENTATION=1",
188 #"$angle_path/include",
189 "$root_gen_dir/blink",
194 ":make_platform_generated",
195 "//gpu/command_buffer/client:gles2_c_lib",
197 "//third_party:jpeg",
198 "//third_party/harfbuzz-ng",
199 "//third_party/iccjpeg",
201 "//third_party/libpng",
202 "//third_party/libwebp",
204 "//third_party/qcms",
205 "//third_party/WebKit/Source/wtf",
206 "//third_party/WebKit/Source/platform/heap",
211 forward_dependent_configs_from = [
212 "//gpu/command_buffer/client:gles2_c_lib",
214 "//third_party:jpeg",
215 "//third_party/iccjpeg",
216 "//third_party/libpng",
217 "//third_party/libwebp",
219 "//third_party/qcms",
226 "fonts/harfbuzz/FontHarfBuzz.cpp",
227 "fonts/harfbuzz/FontPlatformDataHarfBuzz.cpp",
228 "fonts/harfbuzz/HarfBuzzFaceSkia.cpp",
229 "fonts/opentype/OpenTypeTypes.h",
230 "fonts/opentype/OpenTypeVerticalData.cpp",
231 "fonts/opentype/OpenTypeVerticalData.h",
232 # The Mac currently uses FontCustomPlatformDataMac.cpp instead.
233 "fonts/skia/FontCustomPlatformDataSkia.cpp",
234 "fonts/skia/FontCacheSkia.cpp",
235 "fonts/skia/SimpleFontDataSkia.cpp",
236 # Uses LocaleMac instead.
237 "text/LocaleICU.cpp",
239 # Uses KillRingMac.mm instead.
241 # Mac uses only ScrollAnimatorMac.
242 "scroll/ScrollbarThemeNonMacCommon.cpp",
243 "scroll/ScrollbarThemeNonMacCommon.h",
244 "scroll/ScrollAnimatorNone.cpp",
245 "scroll/ScrollAnimatorNone.h",
248 # Some Mac-specific parts of WebKit won't compile without having this
249 # prefix header injected.
252 rebase_path("../build/mac/Prefix.h", root_build_dir),
255 defines += [ "WebFontCache=ChromiumWebCoreObjCWebFontCache" ]
256 configs += [ ":mac_objc_renaming" ]
258 "Accelerate.framework",
260 "Foundation.framework",
264 # FIXME: We will eventually compile this too, but for now it's
266 "fonts/FontPlatformData.cpp",
267 "fonts/harfbuzz/HarfBuzzFaceCoreText.cpp",
268 "geometry/cg/FloatPointCG.cpp",
269 "geometry/cg/FloatRectCG.cpp",
270 "geometry/cg/FloatSizeCG.cpp",
271 "geometry/cg/IntPointCG.cpp",
272 "geometry/cg/IntRectCG.cpp",
273 "geometry/cg/IntSizeCG.cpp",
279 # Uses LocaleWin instead.
280 "text/LocaleICU.cpp",
284 "/wd4267", # Conversion from 'size_t' to 'type', possible loss of data.
285 "/wd4334", # Result of 32-bit shift implicitly converted to 64 bits.
286 "/wd4724", # Modulo by 0.
290 "clipboard/ClipboardUtilitiesWin.cpp",
291 "fonts/opentype/OpenTypeUtilities.cpp",
292 "fonts/opentype/OpenTypeUtilities.h",
293 "text/LocaleWin.cpp",
298 # Add in some Linux files also shared with Android.
299 set_sources_assignment_filter([])
301 "exported/linux/WebFontRenderStyle.cpp",
302 "fonts/linux/FontPlatformDataLinux.cpp",
304 set_sources_assignment_filter(sources_assignment_filter)
307 "scroll/ScrollbarThemeAndroid.cpp",
312 direct_dependent_configs = [ "//build/config/linux:fontconfig" ]
315 if (!use_default_render_theme) {
317 "scroll/ScrollbarThemeAura.cpp",
318 "scroll/ScrollbarThemeAura.h",
322 if (cpu_arch == "arm") {
323 deps += [ ":blink_arm_neon" ]
326 if (use_webaudio_ffmpeg) {
327 include_dirs += [ "//third_party/ffmpeg" ]
328 deps += [ "//third_party/ffmpeg" ]
330 if (use_openmax_dl_fft) {
331 include_dirs += [ "//third_party/openmax_dl" ]
333 # deps += [ "//third_party/openmax_dl/dl" ]
337 yasm_assemble("heap_asm_stubs") {
338 if (cpu_arch == "x86" || cpu_arch == "x64") {
339 sources = [ "heap/asm/SaveRegisters_x86.asm" ]
340 } else if (cpu_arch == "arm") {
341 sources = [ "heap/asm/SaveRegisters_arm.S" ]
342 } else if (cpu_arch == "arm64") {
343 sources = [ "heap/asm/SaveRegisters_arm64.S" ]
344 } else if (cpu_arch == "mipsel") {
345 sources = [ "heap/asm/SaveRegisters_mips.S" ]
350 # Necessary to ensure symbols end up with a _ prefix; added by
351 # yasm_compile.gypi for Windows, but not Mac.
352 yasm_flags += [ "-DPREFIX" ]
354 if (cpu_arch == "x64") {
356 yasm_flags += [ "-DX64WIN=1" ]
358 yasm_flags += [ "-DX64POSIX=1" ]
360 } else if (cpu_arch == "x86") {
361 yasm_flags += [ "-DIA32=1" ]
362 } else if (cpu_arch == "arm") {
363 yasm_flags += [ "-DARM=1" ]
368 test("heap_unittests") {
369 visibility = "//third_party/WebKit/*"
370 output_name = "blink_heap_unittests"
372 sources = rebase_path(heap_gypi.platform_heap_test_files, ".", "heap")
373 sources += [ "heap/RunAllTests.cpp" ]
376 "//third_party/WebKit/Source/wtf:wtf_config",
377 "//third_party/WebKit/Source:config",
384 "//base/test:test_support",
387 "//third_party/WebKit/Source/wtf",
388 "//third_party/WebKit/Source/wtf:test_support",
392 test("platform_unittests") {
393 visibility = "//third_party/WebKit/*"
394 output_name = "blink_platform_unittests"
396 sources = platform_test_files
398 sources += [ "testing/RunAllTests.cpp" ]
401 "//third_party/WebKit/Source/wtf:wtf_config",
402 "//third_party/WebKit/Source:config",
410 "//base/test:test_support",
414 "//third_party/WebKit/Source/wtf",
415 "//third_party/WebKit/Source/wtf:test_support",
424 "$root_gen_dir/blink",
429 if (cpu_arch == "arm") {
430 source_set("blink_arm_neon") {
431 sources = blink_platform_neon_files
433 # The *NEON.cpp files fail to compile when -mthumb is passed. Force
434 # them to build in ARM mode.
435 # See https://bugs.webkit.org/show_bug.cgi?id=62916.
437 #'cflags': ['-marm'],
439 # ['OS=="android"', {
440 # 'cflags!': ['-mthumb'],
444 deps = [ ":blink_common" ]