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("//testing/test.gni")
7 import("//third_party/WebKit/Source/build/scripts/scripts.gni")
8 import("//third_party/WebKit/Source/config.gni")
9 import("//third_party/WebKit/Source/platform/platform.gni")
10 import("//third_party/WebKit/Source/platform/platform_generated.gni")
12 # Most targets in this file are private actions so use that as the default.
16 # TODO(GYP): can't link Blink binaries yet on mac.
17 heap_gypi = exec_script(
18 "//build/gypi_to_gn.py",
19 [ rebase_path("heap/blink_heap.gypi") ],
21 [ "heap/blink_heap.gypi" ])
24 blink_platform_neon_files = [
25 "graphics/cpu/arm/WebGLImageConversionNEON.h",
28 blink_platform_sse_files = [
29 "graphics/cpu/x86/WebGLImageConversionSSE.h",
32 # blink_common in blink_platform.gyp
33 component("blink_common") {
34 visibility = [] # Allow re-assignment of list.
35 visibility = [ "//third_party/WebKit/*" ]
37 "exported/WebCString.cpp",
38 "exported/WebString.cpp",
39 "exported/WebCommon.cpp",
43 "BLINK_COMMON_IMPLEMENTATION=1",
48 "//build/config/compiler:wexit_time_destructors",
49 "//third_party/WebKit/Source:config",
50 "//third_party/WebKit/Source:non_test_config",
54 "//third_party/WebKit/Source/wtf",
58 # Chromium's version of WebCore includes the following Objective-C classes. The
59 # system-provided WebCore framework may also provide these classes. Because of
60 # the nature of Objective-C binding (dynamically at runtime), it's possible for
61 # the Chromium-provided versions to interfere with the system-provided
62 # versions. This may happen when a system framework attempts to use
63 # core.framework, such as when converting an HTML-flavored string to an
64 # NSAttributedString. The solution is to force Objective-C class names that
65 # would conflict to use alternate names.
67 # This list will hopefully shrink but may also grow. Its performance is
68 # monitored by the "Check Objective-C Rename" postbuild step, and any
69 # suspicious-looking symbols not handled here or whitelisted in that step will
70 # cause a build failure.
72 # If this is unhandled, the console will receive log messages
74 # 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.
76 config("mac_objc_renaming") {
78 "WebCascadeList=ChromiumWebCoreObjCWebCascadeList",
79 "WebFontCache=ChromiumWebCoreObjCWebFontCache",
80 "WebScrollAnimationHelperDelegate=ChromiumWebCoreObjCWebScrollAnimationHelperDelegate",
81 "WebScrollbarPainterControllerDelegate=ChromiumWebCoreObjCWebScrollbarPainterControllerDelegate",
82 "WebScrollbarPainterDelegate=ChromiumWebCoreObjCWebScrollbarPainterDelegate",
83 "WebScrollbarPartAnimation=ChromiumWebCoreObjCWebScrollbarPartAnimation",
84 "WebCoreFlippedView=ChromiumWebCoreObjCWebCoreFlippedView",
85 "WebCoreScrollbarObserver=ChromiumWebCoreObjCWebCoreScrollbarObserver",
86 "WebCoreTextFieldCell=ChromiumWebCoreObjCWebCoreTextFieldCell",
91 # FontFamilyNames action in make_platform_generated in
92 # platform_generated.gyp
93 action("font_family_names") {
94 script = "../build/scripts/make_names.py"
96 font_family_names_in = "fonts/FontFamilyNames.in"
97 inputs = make_names_files + [ font_family_names_in ]
100 "$blink_platform_output_dir/FontFamilyNames.cpp",
101 "$blink_platform_output_dir/FontFamilyNames.h",
105 rebase_path(font_family_names_in, root_build_dir),
107 rebase_path(blink_platform_output_dir, root_build_dir),
111 # RuntimeEnabledFeatures action in make_platform_generated in
112 # platform_generated.gyp
113 action("runtime_enabled_features") {
114 script = "../build/scripts/make_runtime_features.py"
116 runtime_enabled_features_in = "RuntimeEnabledFeatures.in"
117 inputs = scripts_for_in_files + [
118 runtime_enabled_features_in,
119 "../build/scripts/templates/RuntimeEnabledFeatures.cpp.tmpl",
120 "../build/scripts/templates/RuntimeEnabledFeatures.h.tmpl",
124 "$blink_platform_output_dir/RuntimeEnabledFeatures.cpp",
125 "$blink_platform_output_dir/RuntimeEnabledFeatures.h",
129 rebase_path(runtime_enabled_features_in, root_build_dir),
131 rebase_path(blink_platform_output_dir, root_build_dir),
135 # ColorData action in make_platform_generated in platform_generated.gyp
136 action("color_data") {
137 script = "../build/scripts/gperf.py"
139 color_data_gperf = "ColorData.gperf"
140 inputs = [ color_data_gperf ]
142 output_file = "$blink_platform_output_dir/ColorData.cpp"
143 outputs = [ output_file ]
149 rebase_path(color_data_gperf, root_build_dir),
150 "--output-file=" + rebase_path(output_file, root_build_dir),
154 # This isn't strictly necessary since we can just add the deps to "platform",
155 # but it helps to have the targets match the GYP build.
156 group("make_platform_generated") {
157 visibility = [] # Allow re-assignment of list.
158 visibility = [ "//third_party/WebKit/Source/*" ]
162 ":font_family_names",
163 ":runtime_enabled_features",
167 # TODO(brettw) Objective C Renaming postbuild steps on Mac.
168 # blink_platform target in blink_platform.gyp
169 component("platform") {
170 visibility = [] # Allow re-assignment of list.
171 visibility = [ "//third_party/WebKit/*" ]
172 output_name = "blink_platform"
174 sources = platform_files
175 sources -= blink_platform_neon_files
176 sources -= blink_platform_sse_files
178 # Add in the generated files.
180 get_target_outputs(":font_family_names") +
181 get_target_outputs(":runtime_enabled_features") +
182 get_target_outputs(":color_data")
185 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
186 "//build/config/compiler:no_size_t_to_int_warning",
187 "//third_party/WebKit/Source:config",
188 "//third_party/WebKit/Source:non_test_config",
192 "BLINK_PLATFORM_IMPLEMENTATION=1",
197 #"$angle_path/include",
198 "$root_gen_dir/blink",
202 "//gpu/command_buffer/client:gles2_c_lib",
204 "//third_party:jpeg",
205 "//third_party/iccjpeg",
206 "//third_party/libpng",
207 "//third_party/libwebp",
209 "//third_party/qcms",
214 ":make_platform_generated",
215 "//third_party/harfbuzz-ng",
217 "//third_party/WebKit/Source/wtf",
218 "//third_party/WebKit/Source/platform/heap",
223 "fonts/skia/FontCacheSkia.cpp",
224 # Uses LocaleMac instead.
225 "text/LocaleICU.cpp",
227 # Uses KillRingMac.mm instead.
229 # Mac uses only ScrollAnimatorMac.
230 "scroll/ScrollbarThemeNonMacCommon.cpp",
231 "scroll/ScrollbarThemeNonMacCommon.h",
232 "scroll/ScrollAnimatorNone.cpp",
233 "scroll/ScrollAnimatorNone.h",
236 # Some Mac-specific parts of WebKit won't compile without having this
237 # prefix header injected.
240 rebase_path("../build/mac/Prefix.h", root_build_dir),
243 defines += [ "WebFontCache=ChromiumWebCoreObjCWebFontCache" ]
244 configs += [ ":mac_objc_renaming" ]
246 "Accelerate.framework",
248 "Foundation.framework",
252 "geometry/cg/FloatPointCG.cpp",
253 "geometry/cg/FloatRectCG.cpp",
254 "geometry/cg/FloatSizeCG.cpp",
255 "geometry/cg/IntPointCG.cpp",
256 "geometry/cg/IntRectCG.cpp",
257 "geometry/cg/IntSizeCG.cpp",
263 "clipboard/ClipboardUtilitiesPosix.cpp",
264 # Uses LocaleWin instead.
265 "text/LocaleICU.cpp",
269 "/wd4334", # Result of 32-bit shift implicitly converted to 64 bits.
270 "/wd4724", # Modulo by 0.
274 "clipboard/ClipboardUtilitiesWin.cpp",
275 "text/LocaleWin.cpp",
280 # Add in some Linux files also shared with Android.
281 set_sources_assignment_filter([])
283 "exported/linux/WebFontRenderStyle.cpp",
284 "fonts/linux/FontPlatformDataLinux.cpp",
286 set_sources_assignment_filter(sources_assignment_filter)
289 "scroll/ScrollbarThemeAndroid.cpp",
294 public_configs = [ "//build/config/linux:fontconfig" ]
297 if (!use_default_render_theme) {
299 "scroll/ScrollbarThemeAura.cpp",
300 "scroll/ScrollbarThemeAura.h",
304 if (current_cpu == "arm") {
305 deps += [ ":blink_arm_neon" ]
308 if (current_cpu == "x86" || current_cpu == "x64") {
309 deps += [ ":blink_x86_sse" ]
312 if (use_webaudio_ffmpeg) {
313 include_dirs += [ "//third_party/ffmpeg" ]
314 deps += [ "//third_party/ffmpeg" ]
316 if (use_openmax_dl_fft) {
317 include_dirs += [ "//third_party/openmax_dl" ]
318 deps += [ "//third_party/openmax_dl/dl" ]
322 source_set("test_support") {
323 sources = platform_test_support_files
324 visibility += [ "//third_party/WebKit/*" ]
327 "//third_party/WebKit/Source:config",
328 "//third_party/WebKit/Source:inside_blink",
329 "//third_party/WebKit/Source:non_test_config",
338 # TODO(GYP): Can't link Blink binaries yet.
339 test("heap_unittests") {
340 visibility = [] # Allow re-assignment of list.
342 output_name = "blink_heap_unittests"
344 sources = rebase_path(heap_gypi.platform_heap_test_files, ".", "heap")
345 sources += [ "heap/RunAllTests.cpp" ]
348 "//third_party/WebKit/Source/wtf:wtf_config",
349 "//third_party/WebKit/Source:config",
360 "//base/test:test_support",
363 "//third_party/WebKit/Source/wtf",
364 "//third_party/WebKit/Source/wtf:test_support",
365 "//content/test:test_support",
369 test("platform_unittests") {
370 visibility = [] # Allow re-assignment of list.
372 output_name = "blink_platform_unittests"
374 sources = platform_test_files
376 sources += [ "testing/RunAllTests.cpp" ]
379 "//third_party/WebKit/Source/wtf:wtf_config",
380 "//third_party/WebKit/Source:config",
389 "//base/test:test_support",
393 "//third_party/harfbuzz-ng",
394 "//third_party/WebKit/Source/wtf",
395 "//third_party/WebKit/Source/wtf:test_support",
404 "$root_gen_dir/blink",
410 if (current_cpu == "arm") {
411 source_set("blink_arm_neon") {
412 sources = blink_platform_neon_files
414 # The *NEON.cpp files fail to compile when -mthumb is passed. Force
415 # them to build in ARM mode.
416 # See https://bugs.webkit.org/show_bug.cgi?id=62916.
418 #'cflags': ['-marm'],
420 # ['OS=="android"', {
421 # 'cflags!': ['-mthumb'],
425 deps = [ ":blink_common" ]
430 if (current_cpu == "x86" || current_cpu == "x64") {
431 source_set("blink_x86_sse") {
432 sources = blink_platform_sse_files
433 deps = [ ":blink_common" ]