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")
11 # Most targets in this file are private actions so use that as the default.
14 heap_gypi = exec_script(
15 "//build/gypi_to_gn.py",
16 [ rebase_path("heap/blink_heap.gypi") ],
18 [ "heap/blink_heap.gypi" ])
20 blink_platform_neon_files = [
21 "graphics/cpu/arm/WebGLImageConversionNEON.h",
22 "graphics/cpu/arm/filters/FEBlendNEON.h",
23 "graphics/cpu/arm/filters/FECompositeArithmeticNEON.h",
24 "graphics/cpu/arm/filters/FEGaussianBlurNEON.h",
25 "graphics/cpu/arm/filters/NEONHelpers.h",
28 # blink_common in blink_platform.gyp
29 component("blink_common") {
30 visibility = [] # Allow re-assignment of list.
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 = [] # Allow re-assignment of list.
154 visibility = [ "//third_party/WebKit/Source/*" ]
158 ":font_family_names",
159 ":runtime_enabled_features",
163 # TODO(brettw) Objective C Renaming postbuild steps on Mac.
164 # blink_platform target in blink_platform.gyp
165 component("platform") {
166 visibility = [] # Allow re-assignment of list.
167 visibility = [ "//third_party/WebKit/*" ]
168 output_name = "blink_platform"
170 sources = platform_files
171 sources -= blink_platform_neon_files
173 # Add in the generated files.
175 get_target_outputs(":font_family_names") +
176 get_target_outputs(":runtime_enabled_features") +
177 get_target_outputs(":color_data")
180 "//third_party/WebKit/Source:config",
181 "//third_party/WebKit/Source:non_test_config",
185 "BLINK_PLATFORM_IMPLEMENTATION=1",
190 #"$angle_path/include",
191 "$root_gen_dir/blink",
195 "//gpu/command_buffer/client:gles2_c_lib",
197 "//third_party:jpeg",
198 "//third_party/iccjpeg",
199 "//third_party/libpng",
200 "//third_party/libwebp",
202 "//third_party/qcms",
207 ":make_platform_generated",
208 "//third_party/harfbuzz-ng",
210 "//third_party/WebKit/Source/wtf",
211 "//third_party/WebKit/Source/platform/heap",
216 "fonts/harfbuzz/FontHarfBuzz.cpp",
217 "fonts/harfbuzz/HarfBuzzFaceSkia.cpp",
218 "fonts/opentype/OpenTypeTypes.h",
219 "fonts/opentype/OpenTypeVerticalData.cpp",
220 "fonts/opentype/OpenTypeVerticalData.h",
221 # The Mac currently uses FontCustomPlatformDataMac.cpp instead.
222 "fonts/skia/FontCustomPlatformDataSkia.cpp",
223 "fonts/skia/FontCacheSkia.cpp",
224 "fonts/skia/SimpleFontDataSkia.cpp",
225 # Uses LocaleMac instead.
226 "text/LocaleICU.cpp",
228 # Uses KillRingMac.mm instead.
230 # Mac uses only ScrollAnimatorMac.
231 "scroll/ScrollbarThemeNonMacCommon.cpp",
232 "scroll/ScrollbarThemeNonMacCommon.h",
233 "scroll/ScrollAnimatorNone.cpp",
234 "scroll/ScrollAnimatorNone.h",
237 # Some Mac-specific parts of WebKit won't compile without having this
238 # prefix header injected.
241 rebase_path("../build/mac/Prefix.h", root_build_dir),
244 defines += [ "WebFontCache=ChromiumWebCoreObjCWebFontCache" ]
245 configs += [ ":mac_objc_renaming" ]
247 "Accelerate.framework",
249 "Foundation.framework",
253 "fonts/harfbuzz/HarfBuzzFaceCoreText.cpp",
254 "geometry/cg/FloatPointCG.cpp",
255 "geometry/cg/FloatRectCG.cpp",
256 "geometry/cg/FloatSizeCG.cpp",
257 "geometry/cg/IntPointCG.cpp",
258 "geometry/cg/IntRectCG.cpp",
259 "geometry/cg/IntSizeCG.cpp",
265 # Uses LocaleWin instead.
266 "text/LocaleICU.cpp",
270 "/wd4267", # Conversion from 'size_t' to 'type', possible loss of data.
271 "/wd4334", # Result of 32-bit shift implicitly converted to 64 bits.
272 "/wd4724", # Modulo by 0.
276 "clipboard/ClipboardUtilitiesWin.cpp",
277 "fonts/opentype/OpenTypeUtilities.cpp",
278 "fonts/opentype/OpenTypeUtilities.h",
279 "text/LocaleWin.cpp",
284 # Add in some Linux files also shared with Android.
285 set_sources_assignment_filter([])
287 "exported/linux/WebFontRenderStyle.cpp",
288 "fonts/linux/FontPlatformDataLinux.cpp",
290 set_sources_assignment_filter(sources_assignment_filter)
293 "scroll/ScrollbarThemeAndroid.cpp",
298 public_configs = [ "//build/config/linux:fontconfig" ]
301 if (!use_default_render_theme) {
303 "scroll/ScrollbarThemeAura.cpp",
304 "scroll/ScrollbarThemeAura.h",
308 if (cpu_arch == "arm") {
309 deps += [ ":blink_arm_neon" ]
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" ]
319 # deps += [ "//third_party/openmax_dl/dl" ]
323 test("heap_unittests") {
324 visibility = [] # Allow re-assignment of list.
325 visibility = [ "//third_party/WebKit/*" ]
326 output_name = "blink_heap_unittests"
328 sources = rebase_path(heap_gypi.platform_heap_test_files, ".", "heap")
329 sources += [ "heap/RunAllTests.cpp" ]
332 "//third_party/WebKit/Source/wtf:wtf_config",
333 "//third_party/WebKit/Source:config",
340 "//base/test:test_support",
343 "//third_party/WebKit/Source/wtf",
344 "//third_party/WebKit/Source/wtf:test_support",
345 "//content/test:test_support",
349 test("platform_unittests") {
350 visibility = [] # Allow re-assignment of list.
351 visibility = [ "//third_party/WebKit/*" ]
352 output_name = "blink_platform_unittests"
354 sources = platform_test_files
356 sources += [ "testing/RunAllTests.cpp" ]
359 "//third_party/WebKit/Source/wtf:wtf_config",
360 "//third_party/WebKit/Source:config",
368 "//base/test:test_support",
372 "//third_party/WebKit/Source/wtf",
373 "//third_party/WebKit/Source/wtf:test_support",
382 "$root_gen_dir/blink",
387 if (cpu_arch == "arm") {
388 source_set("blink_arm_neon") {
389 sources = blink_platform_neon_files
391 # The *NEON.cpp files fail to compile when -mthumb is passed. Force
392 # them to build in ARM mode.
393 # See https://bugs.webkit.org/show_bug.cgi?id=62916.
395 #'cflags': ['-marm'],
397 # ['OS=="android"', {
398 # 'cflags!': ['-mthumb'],
402 deps = [ ":blink_common" ]