2 # Copyright (C) 2013 Google Inc. All rights reserved.
4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are
8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above
11 # copyright notice, this list of conditions and the following disclaimer
12 # in the documentation and/or other materials provided with the
14 # * Neither the name of Google Inc. nor the names of its
15 # contributors may be used to endorse or promote products derived from
16 # this software without specific prior written permission.
18 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 '../build/features.gypi',
33 '../build/scripts/scripts.gypi',
34 '../build/win/precompile.gypi',
35 'blink_platform.gypi',
38 'target_name': 'blink_common',
39 'type': '<(component)',
40 'variables': { 'enable_wexit_time_destructors': 1 },
42 '../config.gyp:config',
44 # FIXME: Can we remove the dependency on Skia?
45 '<(DEPTH)/skia/skia.gyp:skia',
47 'all_dependent_settings': {
52 'export_dependent_settings': [
53 '<(DEPTH)/skia/skia.gyp:skia',
56 'BLINK_COMMON_IMPLEMENTATION=1',
60 'exported/WebCString.cpp',
61 'exported/WebString.cpp',
62 'exported/WebCommon.cpp',
66 'target_name': 'blink_prerequisites',
70 'direct_dependent_settings': {
72 # Chromium's version of WebCore includes the following Objective-C
73 # classes. The system-provided WebCore framework may also provide
74 # these classes. Because of the nature of Objective-C binding
75 # (dynamically at runtime), it's possible for the
76 # Chromium-provided versions to interfere with the system-provided
77 # versions. This may happen when a system framework attempts to
78 # use core.framework, such as when converting an HTML-flavored
79 # string to an NSAttributedString. The solution is to force
80 # Objective-C class names that would conflict to use alternate
83 # This list will hopefully shrink but may also grow. Its
84 # performance is monitored by the "Check Objective-C Rename"
85 # postbuild step, and any suspicious-looking symbols not handled
86 # here or whitelisted in that step will cause a build failure.
88 # If this is unhandled, the console will receive log messages
90 # 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.
91 'WebCascadeList=ChromiumWebCoreObjCWebCascadeList',
92 'WebFontCache=ChromiumWebCoreObjCWebFontCache',
93 'WebScrollAnimationHelperDelegate=ChromiumWebCoreObjCWebScrollAnimationHelperDelegate',
94 'WebScrollbarPainterControllerDelegate=ChromiumWebCoreObjCWebScrollbarPainterControllerDelegate',
95 'WebScrollbarPainterDelegate=ChromiumWebCoreObjCWebScrollbarPainterDelegate',
96 'WebScrollbarPartAnimation=ChromiumWebCoreObjCWebScrollbarPartAnimation',
97 'WebCoreFlippedView=ChromiumWebCoreObjCWebCoreFlippedView',
98 'WebCoreTextFieldCell=ChromiumWebCoreObjCWebCoreTextFieldCell',
99 'WebCoreRenderThemeNotificationObserver=ChromiumWebCoreObjCWebCoreRenderThemeNotificationObserver',
103 # This step ensures that any Objective-C names that aren't
104 # redefined to be "safe" above will cause a build failure.
105 'postbuild_name': 'Check Objective-C Rename',
107 'class_whitelist_regex':
108 'ChromiumWebCoreObjC|TCMVisibleView|RTCMFlippedView|ScrollerStyleObserver',
109 'category_whitelist_regex':
110 'TCMInterposing|ScrollAnimatorChromiumMacExt|WebCoreTheme',
113 '../build/scripts/check_objc_rename.sh',
114 '<(class_whitelist_regex)',
115 '<(category_whitelist_regex)',
124 'target_name': 'blink_platform',
125 'type': '<(component)',
127 '../config.gyp:config',
128 '../wtf/wtf.gyp:wtf',
130 'blink_prerequisites',
131 '<(DEPTH)/gpu/gpu.gyp:gles2_c_lib',
132 '<(DEPTH)/skia/skia.gyp:skia',
133 '<(DEPTH)/third_party/icu/icu.gyp:icui18n',
134 '<(DEPTH)/third_party/icu/icu.gyp:icuuc',
135 '<(DEPTH)/third_party/libpng/libpng.gyp:libpng',
136 '<(DEPTH)/third_party/libwebp/libwebp.gyp:libwebp',
137 '<(DEPTH)/third_party/ots/ots.gyp:ots',
138 '<(DEPTH)/third_party/qcms/qcms.gyp:qcms',
139 '<(DEPTH)/url/url.gyp:url_lib',
140 '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
141 'platform_generated.gyp:make_platform_generated',
142 '<(DEPTH)/third_party/iccjpeg/iccjpeg.gyp:iccjpeg',
143 '<(libjpeg_gyp_path):libjpeg',
145 'export_dependent_settings': [
146 '<(DEPTH)/gpu/gpu.gyp:gles2_c_lib',
147 '<(DEPTH)/skia/skia.gyp:skia',
148 '<(DEPTH)/third_party/libpng/libpng.gyp:libpng',
149 '<(DEPTH)/third_party/libwebp/libwebp.gyp:libwebp',
150 '<(DEPTH)/third_party/ots/ots.gyp:ots',
151 '<(DEPTH)/third_party/qcms/qcms.gyp:qcms',
152 '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
153 '<(DEPTH)/url/url.gyp:url_lib',
154 '<(DEPTH)/third_party/iccjpeg/iccjpeg.gyp:iccjpeg',
155 '<(libjpeg_gyp_path):libjpeg',
158 'BLINK_PLATFORM_IMPLEMENTATION=1',
162 '<(angle_path)/include',
163 '<(SHARED_INTERMEDIATE_DIR)/blink',
166 # Some Mac-specific parts of WebKit won't compile without having this
167 # prefix header injected.
168 # FIXME: make this a first-class setting.
169 'GCC_PREFIX_HEADER': '../core/WebCorePrefixMac.h',
172 '<@(platform_files)',
174 # Additional .cpp files from platform_generated.gyp:make_platform_generated actions.
175 '<(SHARED_INTERMEDIATE_DIR)/blink/FontFamilyNames.cpp',
176 '<(SHARED_INTERMEDIATE_DIR)/blink/RuntimeEnabledFeatures.cpp',
177 '<(SHARED_INTERMEDIATE_DIR)/blink/RuntimeEnabledFeatures.h',
178 '<(SHARED_INTERMEDIATE_DIR)/blink/ColorData.cpp',
181 # Exclude all platform specific things, reinclude them below on a per-platform basis
182 # FIXME: Figure out how to store these patterns in a variable.
183 ['exclude', '(cf|cg|harfbuzz|mac|opentype|win)/'],
184 ['exclude', '(?<!Chromium)(CF|CG|Mac|Win)\\.(cpp|mm?)$'],
186 # *NEON.cpp files need special compile options.
187 # They are moved to the webcore_0_neon target.
188 ['exclude', 'graphics/cpu/arm/.*NEON\\.(cpp|h)'],
189 ['exclude', 'graphics/cpu/arm/filters/.*NEON\\.(cpp|h)'],
191 # Disable c4267 warnings until we fix size_t to int truncations.
192 # Disable c4724 warnings which is generated in VS2012 due to improper
193 # compiler optimizations, see crbug.com/237063
194 'msvs_disabled_warnings': [ 4267, 4334, 4724 ],
196 ['OS=="linux" or OS=="android"', {
198 # Cherry-pick files excluded by the broader regular expressions above.
199 ['include', 'fonts/harfbuzz/FontHarfBuzz\\.cpp$'],
200 ['include', 'fonts/harfbuzz/FontPlatformDataHarfBuzz\\.cpp$'],
201 ['include', 'fonts/harfbuzz/HarfBuzzFace\\.(cpp|h)$'],
202 ['include', 'fonts/harfbuzz/HarfBuzzFaceSkia\\.cpp$'],
203 ['include', 'fonts/harfbuzz/HarfBuzzShaper\\.(cpp|h)$'],
204 ['include', 'fonts/opentype/OpenTypeTypes\\.h$'],
205 ['include', 'fonts/opentype/OpenTypeVerticalData\\.(cpp|h)$'],
206 ['include', 'fonts/skia/SimpleFontDataSkia\\.cpp$'],
209 '<(DEPTH)/third_party/harfbuzz-ng/harfbuzz.gyp:harfbuzz-ng',
211 }, { # OS!="linux" and OS!="android"
213 ['exclude', 'Harfbuzz[^/]+\\.(cpp|h)$'],
218 '<(DEPTH)/third_party/harfbuzz-ng/harfbuzz.gyp:harfbuzz-ng',
222 '$(SDKROOT)/System/Library/Frameworks/Accelerate.framework',
223 '$(SDKROOT)/System/Library/Frameworks/Carbon.framework',
224 '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
228 # We use LocaleMac.mm instead of LocaleICU.cpp
229 ['exclude', 'text/LocaleICU\\.(cpp|h)$'],
230 ['include', 'text/LocaleMac\\.mm$'],
232 # The Mac uses mac/KillRingMac.mm instead of the dummy
234 ['exclude', 'KillRingNone\\.cpp$'],
236 # The Mac build is USE(CF).
237 ['include', 'CF\\.cpp$'],
239 # Use native Mac font code from core.
240 ['include', '(fonts/)?mac/[^/]*Font[^/]*\\.(cpp|mm?)$'],
241 ['include', 'fonts/mac/ComplexText[^/]*\\.(cpp|h)$'],
243 # Cherry-pick some files that can't be included by broader regexps.
244 # Some of these are used instead of Chromium platform files, see
245 # the specific exclusions in the "exclude" list below.
246 ['include', 'audio/mac/FFTFrameMac\\.cpp$'],
247 ['include', 'fonts/mac/GlyphPageTreeNodeMac\\.cpp$'],
248 ['include', 'fonts/mac/ComplexTextControllerCoreText\\.mm$'],
249 ['include', 'mac/ColorMac\\.mm$'],
250 ['include', 'mac/BlockExceptions\\.mm$'],
251 ['include', 'mac/KillRingMac\\.mm$'],
252 ['include', 'mac/LocalCurrentGraphicsContext\\.mm$'],
253 ['include', 'mac/NSScrollerImpDetails\\.mm$'],
254 ['include', 'mac/ScrollAnimatorMac\\.mm$'],
255 ['include', 'mac/ScrollElasticityController\\.mm$'],
256 ['include', 'mac/ThemeMac\\.h$'],
257 ['include', 'mac/ThemeMac\\.mm$'],
259 # Mac uses only ScrollAnimatorMac.
260 ['exclude', 'scroll/ScrollbarThemeNonMacCommon\\.(cpp|h)$'],
261 ['exclude', 'scroll/ScrollAnimatorNone\\.cpp$'],
262 ['exclude', 'scroll/ScrollAnimatorNone\\.h$'],
264 # The Mac currently uses FontCustomPlatformDataMac.cpp,
265 # included by regex above, instead.
266 ['exclude', 'fonts/skia/FontCustomPlatformDataSkia\\.cpp$'],
268 ['exclude', 'fonts/skia/FontCacheSkia\\.cpp$'],
269 ['exclude', 'fonts/skia/GlyphPageTreeNodeSkia\\.cpp$'],
270 ['exclude', 'fonts/skia/SimpleFontDataSkia\\.cpp$'],
273 ['include', 'fonts/harfbuzz/HarfBuzzFaceCoreText\\.cpp$'],
274 ['include', 'fonts/harfbuzz/HarfBuzzFace\\.(cpp|h)$'],
275 ['include', 'fonts/harfbuzz/HarfBuzzShaper\\.(cpp|h)$'],
277 ['include', 'geometry/mac/FloatPointMac\\.mm$'],
278 ['include', 'geometry/mac/FloatRectMac\\.mm$'],
279 ['include', 'geometry/mac/FloatSizeMac\\.mm$'],
280 ['include', 'geometry/mac/IntPointMac\\.mm$'],
281 ['include', 'geometry/mac/IntRectMac\\.mm$'],
283 ['include', 'geometry/cg/FloatPointCG\\.cpp$'],
284 ['include', 'geometry/cg/FloatRectCG\\.cpp$'],
285 ['include', 'geometry/cg/FloatSizeCG\\.cpp$'],
286 ['include', 'geometry/cg/IntPointCG\\.cpp$'],
287 ['include', 'geometry/cg/IntRectCG\\.cpp$'],
288 ['include', 'geometry/cg/IntSizeCG\\.cpp$'],
291 'WebFontCache=ChromiumWebCoreObjCWebFontCache',
296 ['exclude', 'geometry/mac/'],
297 ['exclude', 'geometry/cg/'],
298 ['exclude', 'scroll/ScrollbarThemeMac'],
300 # FIXME: We will eventually compile this too, but for now it's
302 ['exclude', 'fonts/FontPlatformData\\.cpp$'],
303 ['exclude', 'fonts/harfbuzz/HarfBuzzFaceCoreText\\.cpp$'],
306 ['OS != "linux" and OS != "mac" and (OS != "win" or (OS == "win" and "ENABLE_GDI_FONTS_ON_WINDOWS=1" in feature_defines))', {
308 ['exclude', 'VDMX[^/]+\\.(cpp|h)$'],
313 # We use LocaleWin.cpp instead of LocaleICU.cpp
314 ['exclude', 'text/LocaleICU\\.(cpp|h)$'],
315 ['include', 'text/LocaleWin\\.(cpp|h)$'],
317 ['include', 'clipboard/ClipboardUtilitiesWin\\.(cpp|h)$'],
319 ['include', 'fonts/win/FontFallbackWin\\.(cpp|h)$'],
320 ['include', 'fonts/win/FontPlatformDataWin\\.(cpp|h)$'],
321 ['include', 'fonts/win/FontWin\\.cpp$'],
322 ['include', 'fonts/opentype/'],
323 ['include', 'fonts/skia/SkiaFontWin\\.(cpp|h)$'],
324 ['include', 'fonts/win/UniscribeHelper\\.(cpp|h)$'],
325 ['include', 'fonts/win/UniscribeHelperTextRun\\.(cpp|h)$'],
327 # SystemInfo.cpp is useful and we don't want to copy it.
328 ['include', 'win/SystemInfo\\.cpp$'],
331 ['"ENABLE_GDI_FONTS_ON_WINDOWS=1" in feature_defines', {
333 ['include', 'fonts/win/FontCustomPlatformDataWin\\.cpp$'],
334 ['exclude', 'fonts/skia/SimpleFontDataSkia\\.cpp$'],
335 ['exclude', 'fonts/skia/GlyphPageTreeNodeSkia\\.cpp$'],
336 ['exclude', 'fonts/skia/FontCacheSkia\\.cpp$'],
337 ['exclude', 'fonts/skia/FontCacheSkiaWin\\.cpp$'],
338 ['exclude', 'fonts/skia/FontCustomPlatformDataSkia\\.cpp$'],
340 },{ # ENABLE_GDI_FONTS_ON_WINDOWS!=1
342 ['include', 'fonts/skia/SimpleFontDataSkia\\.cpp$'],
343 ['include', 'fonts/skia/GlyphPageTreeNodeSkia\\.cpp$'],
344 ['include', 'fonts/skia/FontCacheSkiaWin\\.cpp$'],
345 ['include', 'fonts/skia/FontCustomPlatformDataSkia\\.cpp$'],
346 ['include', 'fonts/skia/FontCustomPlatformDataSkia\\.cpp$'],
347 ['exclude', 'fonts/win/FontCustomPlatformDataWin\\.cpp$'],
348 ['exclude', 'fonts/win/SimpleFontDataWin\\.cpp$'],
349 ['exclude', 'fonts/GlyphPageTreeNodeWin\\.cpp$'],
350 ['exclude', 'fonts/FontCacheWin\\.cpp$'],
353 ['"ENABLE_HARFBUZZ_ON_WINDOWS=1" in feature_defines', {
355 ['include', 'fonts/harfbuzz/FontHarfBuzz\\.cpp$'],
356 ['include', 'fonts/harfbuzz/HarfBuzzFace\\.(cpp|h)$'],
357 ['include', 'fonts/harfbuzz/HarfBuzzFaceSkia\\.cpp$'],
358 ['include', 'fonts/harfbuzz/HarfBuzzShaper\\.(cpp|h)$'],
359 ['exclude', 'fonts/win/FontWin\\.cpp$'],
360 ['exclude', '/(Uniscribe)[^/]*\\.(cpp|h)$'],
363 '<(DEPTH)/third_party/harfbuzz-ng/harfbuzz.gyp:harfbuzz-ng',
370 ['exclude', 'Win\\.cpp$'],
371 ['exclude', '/(Windows|Uniscribe)[^/]*\\.cpp$'],
372 ['include', 'fonts/opentype/OpenTypeSanitizer\\.cpp$'],
375 ['OS=="win" and chromium_win_pch==1', {
377 ['include', '<(DEPTH)/third_party/WebKit/Source/build/win/Precompile.cpp'],
382 ['include', '^fonts/VDMXParser\\.cpp$'],
386 ['exclude', 'Android\\.cpp$'],
391 '<(DEPTH)/build/linux/system.gyp:fontconfig',
393 'export_dependent_settings': [
394 '<(DEPTH)/build/linux/system.gyp:fontconfig',
397 ['use_default_render_theme==0', {
399 ['exclude', 'scroll/ScrollbarThemeGtkOrAura\\.(cpp|h)'],
402 ['"WTF_USE_WEBAUDIO_FFMPEG=1" in feature_defines', {
404 '<(DEPTH)/third_party/ffmpeg',
407 '<(DEPTH)/third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
410 ['"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1" in feature_defines', {
412 '<(DEPTH)/third_party/openmax_dl',
415 '<(DEPTH)/third_party/openmax_dl/dl/dl.gyp:openmax_dl',
418 ['target_arch=="arm"', {
424 'target_conditions': [
427 ['include', 'exported/linux/WebFontRenderStyle\\.cpp$'],
432 # The *NEON.cpp files fail to compile when -mthumb is passed. Force
433 # them to build in ARM mode.
434 # See https://bugs.webkit.org/show_bug.cgi?id=62916.
436 'target_name': 'blink_arm_neon',
438 ['target_arch=="arm"', {
439 'type': 'static_library',
443 'hard_dependency': 1,
445 '<@(platform_files)',
449 ['include', 'graphics/cpu/arm/filters/.*NEON\\.(cpp|h)'],
454 'cflags!': ['-mthumb'],
457 },{ # target_arch!="arm"