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",
24 # blink_common in blink_platform.gyp
25 component("blink_common") {
26 visibility = [] # Allow re-assignment of list.
27 visibility = [ "//third_party/WebKit/*" ]
29 "exported/WebCString.cpp",
30 "exported/WebString.cpp",
31 "exported/WebCommon.cpp",
35 "BLINK_COMMON_IMPLEMENTATION=1",
40 "//build/config/compiler:wexit_time_destructors",
41 "//third_party/WebKit/Source:config",
42 "//third_party/WebKit/Source:non_test_config",
46 "//third_party/WebKit/Source/wtf",
50 # Chromium's version of WebCore includes the following Objective-C classes. The
51 # system-provided WebCore framework may also provide these classes. Because of
52 # the nature of Objective-C binding (dynamically at runtime), it's possible for
53 # the Chromium-provided versions to interfere with the system-provided
54 # versions. This may happen when a system framework attempts to use
55 # core.framework, such as when converting an HTML-flavored string to an
56 # NSAttributedString. The solution is to force Objective-C class names that
57 # would conflict to use alternate names.
59 # This list will hopefully shrink but may also grow. Its performance is
60 # monitored by the "Check Objective-C Rename" postbuild step, and any
61 # suspicious-looking symbols not handled here or whitelisted in that step will
62 # cause a build failure.
64 # If this is unhandled, the console will receive log messages
66 # 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.
68 config("mac_objc_renaming") {
70 "WebCascadeList=ChromiumWebCoreObjCWebCascadeList",
71 "WebFontCache=ChromiumWebCoreObjCWebFontCache",
72 "WebScrollAnimationHelperDelegate=ChromiumWebCoreObjCWebScrollAnimationHelperDelegate",
73 "WebScrollbarPainterControllerDelegate=ChromiumWebCoreObjCWebScrollbarPainterControllerDelegate",
74 "WebScrollbarPainterDelegate=ChromiumWebCoreObjCWebScrollbarPainterDelegate",
75 "WebScrollbarPartAnimation=ChromiumWebCoreObjCWebScrollbarPartAnimation",
76 "WebCoreFlippedView=ChromiumWebCoreObjCWebCoreFlippedView",
77 "WebCoreTextFieldCell=ChromiumWebCoreObjCWebCoreTextFieldCell",
78 "WebCoreRenderThemeNotificationObserver=ChromiumWebCoreObjCWebCoreRenderThemeNotificationObserver",
83 # FontFamilyNames action in make_platform_generated in
84 # platform_generated.gyp
85 action("font_family_names") {
86 script = "../build/scripts/make_names.py"
88 font_family_names_in = "fonts/FontFamilyNames.in"
89 inputs = make_names_files + [ font_family_names_in ]
92 "$blink_platform_output_dir/FontFamilyNames.cpp",
93 "$blink_platform_output_dir/FontFamilyNames.h",
97 rebase_path(font_family_names_in, root_build_dir),
99 rebase_path(blink_platform_output_dir, root_build_dir),
103 # RuntimeEnabledFeatures action in make_platform_generated in
104 # platform_generated.gyp
105 action("runtime_enabled_features") {
106 script = "../build/scripts/make_runtime_features.py"
108 runtime_enabled_features_in = "RuntimeEnabledFeatures.in"
109 inputs = scripts_for_in_files + [
110 runtime_enabled_features_in,
111 "../build/scripts/templates/RuntimeEnabledFeatures.cpp.tmpl",
112 "../build/scripts/templates/RuntimeEnabledFeatures.h.tmpl",
116 "$blink_platform_output_dir/RuntimeEnabledFeatures.cpp",
117 "$blink_platform_output_dir/RuntimeEnabledFeatures.h",
121 rebase_path(runtime_enabled_features_in, root_build_dir),
123 rebase_path(blink_platform_output_dir, root_build_dir),
127 # ColorData action in make_platform_generated in platform_generated.gyp
128 action("color_data") {
129 script = "../build/scripts/gperf.py"
131 color_data_gperf = "ColorData.gperf"
132 inputs = [ color_data_gperf ]
134 output_file = "$blink_platform_output_dir/ColorData.cpp"
135 outputs = [ output_file ]
141 rebase_path(color_data_gperf, root_build_dir),
142 "--output-file=" + rebase_path(output_file, root_build_dir),
146 # This isn't strictly necessary since we can just add the deps to "platform",
147 # but it helps to have the targets match the GYP build.
148 group("make_platform_generated") {
149 visibility = [] # Allow re-assignment of list.
150 visibility = [ "//third_party/WebKit/Source/*" ]
154 ":font_family_names",
155 ":runtime_enabled_features",
159 # TODO(brettw) Objective C Renaming postbuild steps on Mac.
160 # blink_platform target in blink_platform.gyp
161 component("platform") {
162 visibility = [] # Allow re-assignment of list.
163 visibility = [ "//third_party/WebKit/*" ]
164 output_name = "blink_platform"
166 sources = platform_files
167 sources -= blink_platform_neon_files
169 # Add in the generated files.
171 get_target_outputs(":font_family_names") +
172 get_target_outputs(":runtime_enabled_features") +
173 get_target_outputs(":color_data")
176 "//third_party/WebKit/Source:config",
177 "//third_party/WebKit/Source:non_test_config",
181 "BLINK_PLATFORM_IMPLEMENTATION=1",
186 #"$angle_path/include",
187 "$root_gen_dir/blink",
191 "//gpu/command_buffer/client:gles2_c_lib",
193 "//third_party:jpeg",
194 "//third_party/iccjpeg",
195 "//third_party/libpng",
196 "//third_party/libwebp",
198 "//third_party/qcms",
203 ":make_platform_generated",
204 "//third_party/harfbuzz-ng",
206 "//third_party/WebKit/Source/wtf",
207 "//third_party/WebKit/Source/platform/heap",
212 "fonts/opentype/OpenTypeTypes.h",
213 "fonts/opentype/OpenTypeVerticalData.cpp",
214 "fonts/opentype/OpenTypeVerticalData.h",
215 # The Mac currently uses FontCustomPlatformDataMac.cpp instead.
216 "fonts/skia/FontCustomPlatformDataSkia.cpp",
217 "fonts/skia/FontCacheSkia.cpp",
218 # Uses LocaleMac instead.
219 "text/LocaleICU.cpp",
221 # Uses KillRingMac.mm instead.
223 # Mac uses only ScrollAnimatorMac.
224 "scroll/ScrollbarThemeNonMacCommon.cpp",
225 "scroll/ScrollbarThemeNonMacCommon.h",
226 "scroll/ScrollAnimatorNone.cpp",
227 "scroll/ScrollAnimatorNone.h",
230 # Some Mac-specific parts of WebKit won't compile without having this
231 # prefix header injected.
234 rebase_path("../build/mac/Prefix.h", root_build_dir),
237 defines += [ "WebFontCache=ChromiumWebCoreObjCWebFontCache" ]
238 configs += [ ":mac_objc_renaming" ]
240 "Accelerate.framework",
242 "Foundation.framework",
246 "geometry/cg/FloatPointCG.cpp",
247 "geometry/cg/FloatRectCG.cpp",
248 "geometry/cg/FloatSizeCG.cpp",
249 "geometry/cg/IntPointCG.cpp",
250 "geometry/cg/IntRectCG.cpp",
251 "geometry/cg/IntSizeCG.cpp",
257 # Uses LocaleWin instead.
258 "text/LocaleICU.cpp",
262 "/wd4267", # Conversion from 'size_t' to 'type', possible loss of data.
263 "/wd4334", # Result of 32-bit shift implicitly converted to 64 bits.
264 "/wd4724", # Modulo by 0.
268 "clipboard/ClipboardUtilitiesWin.cpp",
269 "fonts/opentype/OpenTypeUtilities.cpp",
270 "fonts/opentype/OpenTypeUtilities.h",
271 "text/LocaleWin.cpp",
276 # Add in some Linux files also shared with Android.
277 set_sources_assignment_filter([])
279 "exported/linux/WebFontRenderStyle.cpp",
280 "fonts/linux/FontPlatformDataLinux.cpp",
282 set_sources_assignment_filter(sources_assignment_filter)
285 "scroll/ScrollbarThemeAndroid.cpp",
290 public_configs = [ "//build/config/linux:fontconfig" ]
293 if (!use_default_render_theme) {
295 "scroll/ScrollbarThemeAura.cpp",
296 "scroll/ScrollbarThemeAura.h",
300 if (cpu_arch == "arm") {
301 deps += [ ":blink_arm_neon" ]
304 if (use_webaudio_ffmpeg) {
305 include_dirs += [ "//third_party/ffmpeg" ]
306 deps += [ "//third_party/ffmpeg" ]
308 if (use_openmax_dl_fft) {
309 include_dirs += [ "//third_party/openmax_dl" ]
310 deps += [ "//third_party/openmax_dl/dl" ]
314 test("heap_unittests") {
315 visibility = [] # Allow re-assignment of list.
316 visibility = [ "//third_party/WebKit/*" ]
317 output_name = "blink_heap_unittests"
319 sources = rebase_path(heap_gypi.platform_heap_test_files, ".", "heap")
320 sources += [ "heap/RunAllTests.cpp" ]
323 "//third_party/WebKit/Source/wtf:wtf_config",
324 "//third_party/WebKit/Source:config",
331 "//base/test:test_support",
334 "//third_party/WebKit/Source/wtf",
335 "//third_party/WebKit/Source/wtf:test_support",
336 "//content/test:test_support",
340 test("platform_unittests") {
341 visibility = [] # Allow re-assignment of list.
342 visibility = [ "//third_party/WebKit/*" ]
343 output_name = "blink_platform_unittests"
345 sources = platform_test_files
347 sources += [ "testing/RunAllTests.cpp" ]
350 "//third_party/WebKit/Source/wtf:wtf_config",
351 "//third_party/WebKit/Source:config",
359 "//base/test:test_support",
363 "//third_party/WebKit/Source/wtf",
364 "//third_party/WebKit/Source/wtf:test_support",
373 "$root_gen_dir/blink",
378 if (cpu_arch == "arm") {
379 source_set("blink_arm_neon") {
380 sources = blink_platform_neon_files
382 # The *NEON.cpp files fail to compile when -mthumb is passed. Force
383 # them to build in ARM mode.
384 # See https://bugs.webkit.org/show_bug.cgi?id=62916.
386 #'cflags': ['-marm'],
388 # ['OS=="android"', {
389 # 'cflags!': ['-mthumb'],
393 deps = [ ":blink_common" ]