File: BUILD.gn

package info (click to toggle)
chromium-browser 41.0.2272.118-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 2,189,132 kB
  • sloc: cpp: 9,691,462; ansic: 3,341,451; python: 712,689; asm: 518,779; xml: 208,926; java: 169,820; sh: 119,353; perl: 68,907; makefile: 28,311; yacc: 13,305; objc: 11,385; tcl: 3,186; cs: 2,225; sql: 2,217; lex: 2,215; lisp: 1,349; pascal: 1,256; awk: 407; ruby: 155; sed: 53; php: 14; exp: 11
file content (400 lines) | stat: -rw-r--r-- 11,691 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/ui.gni")
import("//third_party/WebKit/Source/build/scripts/scripts.gni")
import("//third_party/WebKit/Source/config.gni")
import("//third_party/WebKit/Source/platform/platform.gni")
import("//third_party/WebKit/Source/platform/platform_generated.gni")

# Most targets in this file are private actions so use that as the default.
visibility = [ ":*" ]

if (!is_mac) {
  # TODO(GYP): can't link Blink binaries yet on mac.
  heap_gypi = exec_script(
      "//build/gypi_to_gn.py",
      [ rebase_path("heap/blink_heap.gypi") ],
      "scope",
      [ "heap/blink_heap.gypi" ])
}

blink_platform_neon_files = [
  "graphics/cpu/arm/WebGLImageConversionNEON.h",
]

# blink_common in blink_platform.gyp
component("blink_common") {
  visibility = []  # Allow re-assignment of list.
  visibility = [ "//third_party/WebKit/*" ]
  sources = [
    "exported/WebCString.cpp",
    "exported/WebString.cpp",
    "exported/WebCommon.cpp",
  ]

  defines = [
    "BLINK_COMMON_IMPLEMENTATION=1",
    "INSIDE_BLINK",
  ]

  configs += [
    "//build/config/compiler:wexit_time_destructors",
    "//third_party/WebKit/Source:config",
    "//third_party/WebKit/Source:non_test_config",
  ]

  deps = [
    "//third_party/WebKit/Source/wtf",
  ]
}

# Chromium's version of WebCore includes the following Objective-C classes. The
# system-provided WebCore framework may also provide these classes. Because of
# the nature of Objective-C binding (dynamically at runtime), it's possible for
# the Chromium-provided versions to interfere with the system-provided
# versions. This may happen when a system framework attempts to use
# core.framework, such as when converting an HTML-flavored string to an
# NSAttributedString. The solution is to force Objective-C class names that
# would conflict to use alternate names.
#
# This list will hopefully shrink but may also grow. Its performance is
# monitored by the "Check Objective-C Rename" postbuild step, and any
# suspicious-looking symbols not handled here or whitelisted in that step will
# cause a build failure.
#
# If this is unhandled, the console will receive log messages
# such as:
# 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.
if (is_mac) {
  config("mac_objc_renaming") {
    defines = [
      "WebCascadeList=ChromiumWebCoreObjCWebCascadeList",
      "WebFontCache=ChromiumWebCoreObjCWebFontCache",
      "WebScrollAnimationHelperDelegate=ChromiumWebCoreObjCWebScrollAnimationHelperDelegate",
      "WebScrollbarPainterControllerDelegate=ChromiumWebCoreObjCWebScrollbarPainterControllerDelegate",
      "WebScrollbarPainterDelegate=ChromiumWebCoreObjCWebScrollbarPainterDelegate",
      "WebScrollbarPartAnimation=ChromiumWebCoreObjCWebScrollbarPartAnimation",
      "WebCoreFlippedView=ChromiumWebCoreObjCWebCoreFlippedView",
      "WebCoreTextFieldCell=ChromiumWebCoreObjCWebCoreTextFieldCell",
      "WebCoreRenderThemeNotificationObserver=ChromiumWebCoreObjCWebCoreRenderThemeNotificationObserver",
    ]
  }
}

# FontFamilyNames action in make_platform_generated in
# platform_generated.gyp
action("font_family_names") {
  script = "../build/scripts/make_names.py"

  font_family_names_in = "fonts/FontFamilyNames.in"
  inputs = make_names_files + [ font_family_names_in ]

  outputs = [
    "$blink_platform_output_dir/FontFamilyNames.cpp",
    "$blink_platform_output_dir/FontFamilyNames.h",
  ]

  args = [
    rebase_path(font_family_names_in, root_build_dir),
    "--output_dir",
    rebase_path(blink_platform_output_dir, root_build_dir),
  ]
}

# RuntimeEnabledFeatures action in make_platform_generated in
# platform_generated.gyp
action("runtime_enabled_features") {
  script = "../build/scripts/make_runtime_features.py"

  runtime_enabled_features_in = "RuntimeEnabledFeatures.in"
  inputs = scripts_for_in_files + [
    runtime_enabled_features_in,
    "../build/scripts/templates/RuntimeEnabledFeatures.cpp.tmpl",
    "../build/scripts/templates/RuntimeEnabledFeatures.h.tmpl",
  ]

  outputs = [
    "$blink_platform_output_dir/RuntimeEnabledFeatures.cpp",
    "$blink_platform_output_dir/RuntimeEnabledFeatures.h",
  ]

  args = [
    rebase_path(runtime_enabled_features_in, root_build_dir),
    "--output_dir",
    rebase_path(blink_platform_output_dir, root_build_dir),
  ]
}

# ColorData action in make_platform_generated in platform_generated.gyp
action("color_data") {
  script = "../build/scripts/gperf.py"

  color_data_gperf = "ColorData.gperf"
  inputs = [ color_data_gperf ]

  output_file = "$blink_platform_output_dir/ColorData.cpp"
  outputs = [ output_file ]

  args = [
    gperf_exe,
    "--key-positions=*",
    "-D", "-s", "2",
    rebase_path(color_data_gperf, root_build_dir),
    "--output-file=" + rebase_path(output_file, root_build_dir),
  ]
}

# This isn't strictly necessary since we can just add the deps to "platform",
# but it helps to have the targets match the GYP build.
group("make_platform_generated") {
  visibility = []  # Allow re-assignment of list.
  visibility = [ "//third_party/WebKit/Source/*" ]
  deps = [
    ":blink_common",
    ":color_data",
    ":font_family_names",
    ":runtime_enabled_features",
  ]
}

# TODO(brettw) Objective C Renaming postbuild steps on Mac.
# blink_platform target in blink_platform.gyp
component("platform") {
  visibility = []  # Allow re-assignment of list.
  visibility = [ "//third_party/WebKit/*" ]
  output_name = "blink_platform"

  sources = platform_files
  sources -= blink_platform_neon_files

  # Add in the generated files.
  sources +=
    get_target_outputs(":font_family_names") +
    get_target_outputs(":runtime_enabled_features") +
    get_target_outputs(":color_data")

  configs += [
    "//third_party/WebKit/Source:config",
    "//third_party/WebKit/Source:non_test_config",
  ]

  defines = [
    "BLINK_PLATFORM_IMPLEMENTATION=1",
    "INSIDE_BLINK",
  ]

  include_dirs = [
    #"$angle_path/include",
    "$root_gen_dir/blink",
  ]

  public_deps = [
    "//gpu/command_buffer/client:gles2_c_lib",
    "//skia",
    "//third_party:jpeg",
    "//third_party/iccjpeg",
    "//third_party/libpng",
    "//third_party/libwebp",
    "//third_party/ots",
    "//third_party/qcms",
    "//url",
    "//v8",
  ]
  deps = [
    ":make_platform_generated",
    "//third_party/harfbuzz-ng",
    "//third_party/icu",
    "//third_party/WebKit/Source/wtf",
    "//third_party/WebKit/Source/platform/heap",
  ]

  if (is_mac) {
    sources -= [
      "fonts/opentype/OpenTypeTypes.h",
      "fonts/opentype/OpenTypeVerticalData.cpp",
      "fonts/opentype/OpenTypeVerticalData.h",
      # The Mac currently uses FontCustomPlatformDataMac.cpp instead.
      "fonts/skia/FontCustomPlatformDataSkia.cpp",
      "fonts/skia/FontCacheSkia.cpp",
      # Uses LocaleMac instead.
      "text/LocaleICU.cpp",
      "text/LocaleICU.h",
      # Uses KillRingMac.mm instead.
      "KillRingNone.cpp",
      # Mac uses only ScrollAnimatorMac.
      "scroll/ScrollbarThemeNonMacCommon.cpp",
      "scroll/ScrollbarThemeNonMacCommon.h",
      "scroll/ScrollAnimatorNone.cpp",
      "scroll/ScrollAnimatorNone.h",
    ]

    # Some Mac-specific parts of WebKit won't compile without having this
    # prefix header injected.
    cflags = [
      "-include",
      rebase_path("../build/mac/Prefix.h", root_build_dir),
    ]

    defines += [ "WebFontCache=ChromiumWebCoreObjCWebFontCache" ]
    configs += [ ":mac_objc_renaming" ]
    libs = [
      "Accelerate.framework",
      "Carbon.framework",
      "Foundation.framework",
    ]
  } else {
    sources -= [
      "geometry/cg/FloatPointCG.cpp",
      "geometry/cg/FloatRectCG.cpp",
      "geometry/cg/FloatSizeCG.cpp",
      "geometry/cg/IntPointCG.cpp",
      "geometry/cg/IntRectCG.cpp",
      "geometry/cg/IntSizeCG.cpp",
    ]
  }

  if (is_win) {
    sources -= [
      "clipboard/ClipboardUtilitiesPosix.cpp",
      # Uses LocaleWin instead.
      "text/LocaleICU.cpp",
      "text/LocaleICU.h",
    ]
    cflags = [
      "/wd4267",  # Conversion from 'size_t' to 'type', possible loss of data.
      "/wd4334",  # Result of 32-bit shift implicitly converted to 64 bits.
      "/wd4724",  # Modulo by 0.
    ]
  } else {
    sources -= [
      "clipboard/ClipboardUtilitiesWin.cpp",
      "text/LocaleWin.cpp",
    ]
  }

  if (is_android) {
    # Add in some Linux files also shared with Android.
    set_sources_assignment_filter([])
    sources += [
      "exported/linux/WebFontRenderStyle.cpp",
      "fonts/linux/FontPlatformDataLinux.cpp",
    ]
    set_sources_assignment_filter(sources_assignment_filter)
  } else {
    sources -= [
      "scroll/ScrollbarThemeAndroid.cpp",
    ]
  }

  if (is_linux) {
    public_configs = [ "//build/config/linux:fontconfig" ]
  }

  if (!use_default_render_theme) {
    sources -= [
      "scroll/ScrollbarThemeAura.cpp",
      "scroll/ScrollbarThemeAura.h",
    ]
  }

  if (cpu_arch == "arm") {
    deps += [ ":blink_arm_neon" ]
  }

  if (use_webaudio_ffmpeg) {
    include_dirs += [ "//third_party/ffmpeg" ]
    deps += [ "//third_party/ffmpeg" ]
  }
  if (use_openmax_dl_fft) {
    include_dirs += [ "//third_party/openmax_dl" ]
    deps += [ "//third_party/openmax_dl/dl" ]
  }
}

if (!is_mac) {
  # TODO(GYP): Can't link Blink binaries yet.
  test("heap_unittests") {
    visibility = []  # Allow re-assignment of list.
    visibility = [ "//third_party/WebKit/*" ]
    output_name = "blink_heap_unittests"

    sources = rebase_path(heap_gypi.platform_heap_test_files, ".", "heap")
    sources += [ "heap/RunAllTests.cpp" ]

    configs += [
      "//third_party/WebKit/Source/wtf:wtf_config",
      "//third_party/WebKit/Source:config",
    ]

    deps = [
      ":platform",
      "//base",
      "//base/allocator",
      "//base/test:test_support",
      "//testing/gmock",
      "//testing/gtest",
      "//third_party/WebKit/Source/wtf",
      "//third_party/WebKit/Source/wtf:test_support",
      "//content/test:test_support",
    ]
  }

  test("platform_unittests") {
    visibility = []  # Allow re-assignment of list.
    visibility = [ "//third_party/WebKit/*" ]
    output_name = "blink_platform_unittests"

    sources = platform_test_files

    sources += [ "testing/RunAllTests.cpp" ]

    configs += [
      "//third_party/WebKit/Source/wtf:wtf_config",
      "//third_party/WebKit/Source:config",
    ]

    deps = [
      ":blink_common",
      ":platform",
      "//base",
      "//base/allocator",
      "//base/test:test_support",
      "//skia",
      "//testing/gmock",
      "//testing/gtest",
      "//third_party/WebKit/Source/wtf",
      "//third_party/WebKit/Source/wtf:test_support",
      "//url",
    ]

    defines = [
      "INSIDE_BLINK",
    ]

    include_dirs = [
      "$root_gen_dir/blink",
    ]
  }
}


if (cpu_arch == "arm") {
  source_set("blink_arm_neon") {
    sources = blink_platform_neon_files

    # The *NEON.cpp files fail to compile when -mthumb is passed. Force
    # them to build in ARM mode.
    # See https://bugs.webkit.org/show_bug.cgi?id=62916.
    # TODO(GYP)
    #'cflags': ['-marm'],
    #    'conditions': [
    #      ['OS=="android"', {
    #        'cflags!': ['-mthumb'],
    #      }],
    #    ],

    deps = [ ":blink_common" ]
  }
}