forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gn
432 lines (384 loc) · 15.4 KB
/
.gn
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
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
# This file is used by the GN meta build system to find the root of the source
# tree and to set startup options. For documentation on the values set in this
# file, run "gn help dotfile" at the command line.
import("//build/dotfile_settings.gni")
import("//third_party/angle/dotfile_settings.gni")
# The location of the build configuration file.
buildconfig = "//build/config/BUILDCONFIG.gn"
# The secondary source root is a parallel directory tree where
# GN build files are placed when they can not be placed directly
# in the source tree, e.g. for third party source trees.
secondary_source = "//build/secondary/"
# These arguments override the default values for items in a declare_args
# block. "gn args" in turn can override these.
#
# In general the value for a build arg in the declare_args block should be the
# default. In some cases, a DEPS-ed in project will want different defaults for
# being built as part of Chrome vs. being built standalone. In this case, the
# Chrome defaults should go here. There should be no overrides here for
# values declared in the main Chrome repository.
#
# Important note for defining defaults: This file is executed before the
# BUILDCONFIG.gn file. That file sets up the global variables like "is_ios".
# This means that the default_args can not depend on the platform,
# architecture, or other build parameters. If you really need that, the other
# repo should define a flag that toggles on a behavior that implements the
# additional logic required by Chrome to set the variables.
default_args = {
# TODO(brettw) bug 684096: Chrome on iOS does not build v8, so "gn gen" prints
# a warning that "Build argument has no effect". When adding a v8 variable, it
# also needs to be defined to src/ios/BUILD.gn (respectively removed from both
# location when it is removed).
v8_extra_library_files = [
# Dependencies used by the extra libraries. Putting them here causes them
# to be executed first during snapshot creation.
"//third_party/blink/renderer/core/streams/CommonOperations.js",
"//third_party/blink/renderer/core/streams/CommonStrings.js",
"//third_party/blink/renderer/core/streams/SimpleQueue.js",
# Extra libraries.
"//third_party/blink/renderer/core/streams/ByteLengthQueuingStrategy.js",
"//third_party/blink/renderer/core/streams/CountQueuingStrategy.js",
"//third_party/blink/renderer/core/streams/ReadableStream.js",
"//third_party/blink/renderer/core/streams/WritableStream.js",
"//third_party/blink/renderer/core/streams/TransformStream.js",
]
v8_experimental_extra_library_files = []
v8_enable_gdbjit = false
v8_imminent_deprecation_warnings = false
# TODO(jochen): Remove this. http://crbug.com/v8/5830,
# http://crbug.com/728583.
v8_check_microtasks_scopes_consistency = false
# Don't include webrtc's builtin task queue implementation.
rtc_link_task_queue_impl = false
# Don't include the iLBC audio codec.
# TODO(bugs.webrtc.org/8396): Once WebRTC gets rid of its internal
# deps on codecs, we can remove this.
rtc_include_ilbc = false
# Changes some setup for the Crashpad build to set them to build against
# Chromium's zlib, base, etc.
crashpad_dependencies = "chromium"
}
# These are the targets to check headers for by default. The files in targets
# matching these patterns (see "gn help label_pattern" for format) will have
# their includes checked for proper dependencies when you run either
# "gn check" or "gn gen --check".
check_targets = [
"//apps/*",
"//ash/*",
"//base/*",
"//blink/*",
"//build/*",
"//cc/*",
#"//chrome/android/*", # 13 errors
"//chrome/app/*",
"//chrome/app_shim/*",
#"//chrome/browser/*", # ~1300 errors
#"//chrome/browser:*", # ~600 errors
"//chrome/browser/accessibility/*",
"//chrome/browser/android/*",
"//chrome/browser/app_mode/*",
"//chrome/browser/apps/*",
"//chrome/browser/assist_ranker/*",
"//chrome/browser/autocomplete/*",
"//chrome/browser/autofill/*",
"//chrome/browser/background/*",
"//chrome/browser/background_fetch/*",
"//chrome/browser/background_sync/*",
"//chrome/browser/banners/*",
"//chrome/browser/bitmap_fetcher/*",
"//chrome/browser/bookmarks/*",
"//chrome/browser/browsing_data/*",
"//chrome/browser/budget_service/*",
"//chrome/browser/captive_portal/*",
"//chrome/browser/chooser_controller/*",
"//chrome/browser/chromeos/*",
"//chrome/browser/client_hints/*",
"//chrome/browser/clipboard/*",
"//chrome/browser/component_updater/*",
"//chrome/browser/conflicts/*",
"//chrome/browser/consent_auditor/*",
"//chrome/browser/content_settings/*",
"//chrome/browser/crash_upload_list/*",
"//chrome/browser/custom_handlers/*",
"//chrome/browser/data_saver/*",
"//chrome/browser/data_use_measurement/*",
"//chrome/browser/dbus/*",
#"//chrome/browser/devtools/*", # 93 errors
"//chrome/browser/diagnostics/*",
"//chrome/browser/domain_reliability/*",
"//chrome/browser/dom_distiller/*",
"//chrome/browser/downgrade/*",
"//chrome/browser/download/*",
"//chrome/browser/drive/*",
"//chrome/browser/engagement/*",
"//chrome/browser/extensions/*",
"//chrome/browser/external_protocol/*",
"//chrome/browser/favicon/*",
"//chrome/browser/feature_engagement/*",
"//chrome/browser/feedback/*",
"//chrome/browser/first_run/*",
"//chrome/browser/gcm/*",
"//chrome/browser/generic_sensor/*",
"//chrome/browser/geolocation/*",
"//chrome/browser/google/*",
"//chrome/browser/gpu/*",
"//chrome/browser/guest_view/*",
"//chrome/browser/hang_monitor/*",
"//chrome/browser/history/*",
"//chrome/browser/importer/*",
"//chrome/browser/infobars/*",
"//chrome/browser/installable/*",
"//chrome/browser/install_verification/*",
"//chrome/browser/internal/*",
"//chrome/browser/interstitials/*",
"//chrome/browser/invalidation/*",
"//chrome/browser/language/*",
"//chrome/browser/lifetime/*",
#"//chrome/browser/loader/*", # 2 errors
"//chrome/browser/local_discovery/*",
"//chrome/browser/mac/*",
#"//chrome/browser/media/*", # 74 errors
"//chrome/browser/media_galleries/*",
"//chrome/browser/memory/*",
"//chrome/browser/metrics/*",
"//chrome/browser/nacl_host/*",
"//chrome/browser/navigation_predictor/*",
"//chrome/browser/net/*",
"//chrome/browser/notifications/*",
"//chrome/browser/ntp_snippets/*",
"//chrome/browser/ntp_tiles/*",
"//chrome/browser/obsolete_system/*",
"//chrome/browser/offline_items_collection/*",
"//chrome/browser/offline_pages/*",
"//chrome/browser/page_load_metrics/*",
"//chrome/browser/password_manager/*",
"//chrome/browser/payments/*",
"//chrome/browser/pdf/*",
"//chrome/browser/performance_monitor/*",
"//chrome/browser/permissions/*",
"//chrome/browser/picture_in_picture/*",
"//chrome/browser/plugins/*",
# "//chrome/browser/policy/*", # 1 error on Windows
"//chrome/browser/predictors/*",
"//chrome/browser/prefetch/*",
"//chrome/browser/prefs/*",
"//chrome/browser/prerender/*",
"//chrome/browser/previews/*",
"//chrome/browser/printing/*",
"//chrome/browser/profile_resetter/*",
"//chrome/browser/profiles/*",
#"//chrome/browser/profiling_host/*", # 16 errors
"//chrome/browser/push_messaging/*",
"//chrome/browser/recovery/*",
"//chrome/browser/renderer_context_menu/*",
"//chrome/browser/renderer_host/*",
"//chrome/browser/resource_coordinator/*",
#"//chrome/browser/resources/*", # 18 errors on ChromeOS
"//chrome/browser/rlz/*",
#"//chrome/browser/safe_browsing/*", # 239 errors
"//chrome/browser/search/*",
"//chrome/browser/search_engines/*",
"//chrome/browser/search_provider_logos/*",
"//chrome/browser/service_process/*",
"//chrome/browser/sessions/*",
"//chrome/browser/signin/*",
"//chrome/browser/speech/*",
"//chrome/browser/spellchecker/*",
"//chrome/browser/ssl/*",
"//chrome/browser/status_icons/*",
"//chrome/browser/storage/*",
"//chrome/browser/subresource_filter/*",
"//chrome/browser/supervised_user/*",
"//chrome/browser/sync/*",
"//chrome/browser/sync_file_system/*",
"//chrome/browser/tab_contents/*",
"//chrome/browser/task_manager/*",
"//chrome/browser/themes/*",
"//chrome/browser/thumbnails/*",
"//chrome/browser/tracing/*",
"//chrome/browser/translate/*",
"//chrome/browser/ui/*",
"//chrome/browser/undo/*",
"//chrome/browser/unified_consent/*",
"//chrome/browser/update_client/*",
"//chrome/browser/upgrade_detector/*",
"//chrome/browser/usb/*",
"//chrome/browser/vr/*",
"//chrome/browser/web_applications/*",
"//chrome/browser/webauthn/*",
"//chrome/browser/webshare/*",
"//chrome/browser/win/*",
"//chrome/build/*",
#"//chrome/child/*", # 1 error on Windows
"//chrome/chrome_cleaner/*",
#"//chrome/chrome_watcher/*", # 3 errors on Windows
"//chrome/common/*",
#"//chrome/elevation_service/*", # 1 error on Windows
#"//chrome/gpu/*", # 7 errors
"//chrome/installer/*",
#"//chrome/install_static/*", # 8 errors on Windows
"//chrome/nacl/*",
#"//chrome/notification_helper/*", # 4 errors on Windows
#"//chrome/renderer/*", # ~30 errors
#"//chrome/service/*", # 2 errors
#"//chrome/services/*", # ~30 errors
#"//chrome/test/*", # ~3000 errors
"//chrome/third_party/*",
"//chrome/tools/*",
"//chrome/utility/*",
"//chromecast/*",
"//chromeos/*",
"//chrome_elf/*",
"//cloud_print/*",
"//components/*",
"//content/*",
"//courgette/*",
"//crypto/*",
"//data/*",
"//dbus/*",
"//device/*",
#"//extensions/*", # Lots of errors.
"//extensions:extensions_resources",
"//extensions:extensions_browsertests",
"//extensions:extensions_unittests",
"//extensions/browser",
"//extensions/browser:browser_tests",
"//extensions/browser:unit_tests",
"//extensions/browser/install:*",
"//extensions/common/*",
"//extensions/components/javascript_dialog_extensions_client",
"//extensions/components/native_app_window",
"//extensions/renderer:unit_tests",
"//extensions/shell/*",
"//extensions/strings/*",
"//gin/*",
"//google_apis/*",
"//google_update/*",
"//gpu/*",
"//ios/*",
"//ios_internal/*",
"//ipc/*",
#"//jingle/*",
"//mash/*",
"//media/*",
"//mojo/*",
#"//native_client/*",
"//net/*",
#"//pdf/*", # Medium-hard.
#"//ppapi/*", # Lots of errors.
"//ppapi/examples/*",
"//ppapi/tests/*",
"//printing/*",
#"//remoting/*", # Medium-hard.
"//rlz/*",
#"//sandbox/*", # Medium-hard.
"//services/*",
"//skia/*",
"//sql/*",
"//storage/*",
"//testing/*",
#"//third_party/*", # May not ever want this.
#"//third_party/breakpad/*", # Small errors.
"//third_party/boringssl/*",
"//third_party/brotli/*",
"//third_party/fuchsia-sdk/*",
"//third_party/hunspell/*",
"//third_party/leveldatabase/*",
#"//third_party/libaddressinput/*", # Small errors.
"//third_party/libphonenumber/*",
#"//third_party/libwebp/*", # Errors: https://crbug.com/800762
"//third_party/snappy/*",
#"//third_party/WebKit/*", # Errors: https://crbug.com/800764
#"//third_party/webrtc/*", # Errors: https://crbug.com/824831
"//third_party/webrtc_overrides/*",
"//tools/*",
"//ui/*",
"//url/*",
#"//v8/*", # Errors: https://bugs.chromium.org/p/v8/issues/detail?id=7330
"//webrunner/*",
]
# These are the list of GN files that run exec_script. This whitelist exists
# to force additional review for new uses of exec_script, which is strongly
# discouraged.
#
# GYPI_TO_GN
#
# Some of these entries are for legacy gypi_to_gn calls. We should not be
# adding new calls to this script in the build (see //build/gypi_to_gn.py for
# detailed advice). The only time you should be editing this list for
# gypi_to_gn purposes is when moving an existing call to a different place.
#
# PLEASE READ
#
# You should almost never need to add new exec_script calls. exec_script is
# slow, especially on Windows, and can cause confusing effects. Although
# individually each call isn't slow or necessarily very confusing, at the scale
# of our repo things get out of hand quickly. By strongly pushing back on all
# additions, we keep the build fast and clean. If you think you need to add a
# new call, please consider:
#
# - Do not use a script to check for the existence of a file or directory to
# enable a different mode. Instead, use GN build args to enable or disable
# functionality and set options. An example is checking for a file in the
# src-internal repo to see if the corresponding src-internal feature should
# be enabled. There are several things that can go wrong with this:
#
# - It's mysterious what causes some things to happen. Although in many cases
# such behavior can be conveniently automatic, GN optimizes for explicit
# and obvious behavior so people can more easily diagnose problems.
#
# - The user can't enable a mode for one build and not another. With GN build
# args, the user can choose the exact configuration of multiple builds
# using one checkout. But implicitly basing flags on the state of the
# checkout, this functionality is broken.
#
# - It's easy to get stale files. If for example the user edits the gclient
# to stop checking out src-internal (or any other optional thing), it's
# easy to end up with stale files still mysteriously triggering build
# conditions that are no longer appropriate (yes, this happens in real
# life).
#
# - Do not use a script to iterate files in a directory (glob):
#
# - This has the same "stale file" problem as the above discussion. Various
# operations can leave untracked files in the source tree which can cause
# surprising effects.
#
# - It becomes impossible to use "git grep" to find where a certain file is
# referenced. This operation is very common and people really do get
# confused when things aren't listed.
#
# - It's easy to screw up. One common case is a build-time script that packs
# up a directory. The author notices that the script isn't re-run when the
# directory is updated, so adds a glob so all the files are listed as
# inputs. This seems to work great... until a file is deleted. When a
# file is deleted, all the inputs the glob lists will still be up to date
# and no command-lines will have been changed. The action will not be
# re-run and the build will be broken. It is possible to get this correct
# using glob, and it's possible to mess it up without glob, but globs make
# this situation much easier to create. if the build always lists the
# files and passes them to a script, it will always be correct.
exec_script_whitelist =
build_dotfile_settings.exec_script_whitelist +
angle_dotfile_settings.exec_script_whitelist +
[
# Whitelist entries for //build should go into
# //build/dotfile_settings.gni instead, so that they can be shared
# with other repos. The entries in this list should be only for files
# in the Chromium repo outside of //build.
"//build_overrides/build.gni",
# TODO(dgn): Layer violation but breaks the build otherwise, see
# https://crbug.com/474506.
"//clank/java/BUILD.gn",
"//clank/native/BUILD.gn",
"//remoting/host/installer/linux/BUILD.gn",
"//remoting/remoting_version.gni",
"//remoting/host/installer/win/generate_clsids.gni",
# TODO(dpranke): Get these from the appropriate repos instead.
"//third_party/catapult/tracing/BUILD.gn",
"//third_party/google_input_tools/inputview.gni",
"//tools/grit/grit_rule.gni",
# Not gypi-to-gn.
"//google_apis/BUILD.gn",
"//printing/BUILD.gn",
]