OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 # IMPORTANT: | 5 # IMPORTANT: |
6 # Please don't directly include this file if you are building via gyp_chromium, | 6 # Please don't directly include this file if you are building via gyp_chromium, |
7 # since gyp_chromium is automatically forcing its inclusion. | 7 # since gyp_chromium is automatically forcing its inclusion. |
8 { | 8 { |
9 # Variables expected to be overriden on the GYP command line (-D) or by | |
10 # ~/.gyp/include.gypi. | |
11 'variables': { | |
12 # Putting a variables dict inside another variables dict looks kind of | |
13 # weird. This is done so that 'host_arch', 'chromeos', etc are defined as | |
14 # variables within the outer variables dict here. This is necessary | |
15 # to get these variables defined for the conditions within this variables | |
16 # dict that operate on these variables. | |
17 'variables': { | |
18 'variables': { | |
19 'variables': { | |
20 'variables': { | |
21 # Whether we're building a ChromeOS build. | |
22 'chromeos%': 0, | |
23 | |
24 # Whether we're building the cast (chromecast) shell | |
25 'chromecast%': 0, | |
26 | |
27 # Whether or not we are using the Aura windowing framework. | |
28 'use_aura%': 0, | |
29 | |
30 # Whether or not we are building the Ash shell. | |
31 'use_ash%': 0, | |
32 | |
33 # Whether or not we are using CRAS, the ChromeOS Audio Server. | |
34 'use_cras%': 0, | |
35 | |
36 # Use a raw surface abstraction. | |
37 'use_ozone%': 0, | |
38 | |
39 # Configure the build for small devices. See crbug.com/318413 | |
40 'embedded%': 0, | |
41 | |
42 'conditions': [ | |
43 # Compute the architecture that we're building on. | |
44 ['OS=="win" or OS=="ios"', { | |
45 'host_arch%': 'ia32', | |
46 }, { | |
47 'host_arch%': '<!pymod_do_main(detect_host_arch)', | |
48 }], | |
49 ], | |
50 }, | |
51 # Copy conditionally-set variables out one scope. | |
52 'chromeos%': '<(chromeos)', | |
53 'chromecast%': '<(chromecast)', | |
54 'use_aura%': '<(use_aura)', | |
55 'use_ash%': '<(use_ash)', | |
56 'use_cras%': '<(use_cras)', | |
57 'use_ozone%': '<(use_ozone)', | |
58 'embedded%': '<(embedded)', | |
59 'host_arch%': '<(host_arch)', | |
60 | |
61 # Whether we are using Views Toolkit | |
62 'toolkit_views%': 0, | |
63 | |
64 # Use the PCI lib to collect GPU information. | |
65 'use_libpci%': 1, | |
66 | |
67 # Use OpenSSL for representing certificates. When targeting Android, | |
68 # the platform certificate library is used for certificate | |
69 # verification. On other targets, this flag also enables OpenSSL for | |
70 # certificate verification, but this configuration is unsupported. | |
71 'use_openssl_certs%': 0, | |
72 | |
73 # Whether or not we use external popup menu. | |
74 'use_external_popup_menu%': 0, | |
75 | |
76 # Disable viewport meta tag by default. | |
77 'enable_viewport%': 0, | |
78 | |
79 # Enable HiDPI support. | |
80 'enable_hidpi%': 0, | |
81 | |
82 # Enable Wayland display server support. | |
83 'enable_wayland_server%' : 0, | |
84 | |
85 # Enable Wi-Fi Display support. | |
86 # WARNING: This enables MPEG Transport Stream (MPEG-TS) encoding! | |
87 'enable_wifi_display%' : 0, | |
88 | |
89 # By default we build against a stable sysroot image to avoid | |
90 # depending on the packages installed on the local machine. Set this | |
91 # to 0 to build against locally installed headers and libraries (e.g. | |
92 # if packaging for a linux distro) | |
93 'use_sysroot%': 1, | |
94 | |
95 # Override buildtype to select the desired build flavor. | |
96 # Dev - everyday build for development/testing | |
97 # Official - release build (generally implies additional processing) | |
98 # TODO(mmoss) Once 'buildtype' is fully supported (e.g. Windows gyp | |
99 # conversion is done), some of the things which are now controlled by | |
100 # 'branding', such as symbol generation, will need to be refactored | |
101 # based on 'buildtype' (i.e. we don't care about saving symbols for | |
102 # non-Official # builds). | |
103 'buildtype%': 'Dev', | |
104 | |
105 # Override branding to select the desired branding flavor. | |
106 'branding%': 'Chromium', | |
107 | |
108 'conditions': [ | |
109 # Windows and Linux use Aura, but not Ash. | |
110 ['OS=="win" or OS=="linux" or OS=="openbsd" or OS=="freebsd"', { | |
111 'use_aura%': 1, | |
112 }], | |
113 | |
114 # ChromeOS uses Ash. | |
115 ['chromeos', { | |
116 'use_ash%': 1, | |
117 }], | |
118 | |
119 ['chromecast==1', { | |
120 'use_libpci': 0, | |
121 'conditions': [ | |
122 ['OS!="android"', { | |
123 'embedded%': 1, | |
124 'use_ozone%': 1, | |
125 }], | |
126 ], | |
127 }], | |
128 | |
129 # Ozone uses Aura. | |
130 ['use_ozone==1', { | |
131 'use_aura%': 1, | |
132 }], | |
133 | |
134 # Whether we're a traditional desktop unix. | |
135 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") a
nd chromeos==0', { | |
136 'desktop_linux%': 1, | |
137 }, { | |
138 'desktop_linux%': 0, | |
139 }], | |
140 | |
141 # Embedded implies ozone. | |
142 ['embedded==1', { | |
143 'use_ozone%': 1, | |
144 }], | |
145 | |
146 # Mac and Android use external popup menu. | |
147 ['OS=="mac" or OS=="android"', { | |
148 'use_external_popup_menu%': 1, | |
149 }], | |
150 | |
151 ['OS=="android"', { | |
152 'target_arch%': 'arm', | |
153 }, { | |
154 # Default architecture we're building for is the architecture we'r
e | |
155 # building on, and possibly sub-architecture (for iOS builds). | |
156 'target_arch%': '<(host_arch)', | |
157 }], | |
158 ], | |
159 }, | |
160 # Copy conditionally-set variables out one scope. | |
161 'chromeos%': '<(chromeos)', | |
162 'chromecast%': '<(chromecast)', | |
163 'desktop_linux%': '<(desktop_linux)', | |
164 'use_aura%': '<(use_aura)', | |
165 'use_ash%': '<(use_ash)', | |
166 'use_cras%': '<(use_cras)', | |
167 'use_ozone%': '<(use_ozone)', | |
168 'embedded%': '<(embedded)', | |
169 'use_libpci%': '<(use_libpci)', | |
170 'use_openssl_certs%': '<(use_openssl_certs)', | |
171 'use_external_popup_menu%': '<(use_external_popup_menu)', | |
172 'enable_viewport%': '<(enable_viewport)', | |
173 'enable_hidpi%': '<(enable_hidpi)', | |
174 'enable_wayland_server%': '<(enable_wayland_server)', | |
175 'enable_wifi_display%': '<(enable_wifi_display)', | |
176 'buildtype%': '<(buildtype)', | |
177 'branding%': '<(branding)', | |
178 'branding_path_component%': '<(branding)', | |
179 'host_arch%': '<(host_arch)', | |
180 'target_arch%': '<(target_arch)', | |
181 'use_sysroot%': '<(use_sysroot)', | |
182 | |
183 # Set to true to instrument the code with function call logger. | |
184 # See src/third_party/cygprofile/cyg-profile.cc for details. | |
185 'order_profiling%': 0, | |
186 | |
187 'target_subarch%': '', | |
188 | |
189 # The channel to build on Android: stable, beta, dev, canary, or | |
190 # default. "default" should be used on non-official builds. | |
191 'android_channel%': 'default', | |
192 | |
193 # Set ARM architecture version. | |
194 'arm_version%': 7, | |
195 | |
196 # Use aurax11 for clipboard implementation. This is true on linux_aura. | |
197 'use_clipboard_aurax11%': 0, | |
198 | |
199 # goma settings. | |
200 # 1 to use goma. | |
201 # If no gomadir is set, it uses the default gomadir. | |
202 'use_goma%': 0, | |
203 'gomadir%': '', | |
204 | |
205 'chroot_cmd%': '', | |
206 | |
207 # The system libdir used for this ABI. | |
208 'system_libdir%': 'lib', | |
209 | |
210 # Default MIPS arch variant. This is set in the conditions block | |
211 # below for MIPS targets. | |
212 'mips_arch_variant%': '', | |
213 | |
214 # MIPS DSP ASE revision. Possible values are: | |
215 # 0: unavailable | |
216 # 1: revision 1 | |
217 # 2: revision 2 | |
218 'mips_dsp_rev%': 0, | |
219 | |
220 # MIPS SIMD Arch compilation flag. | |
221 'mips_msa%': 1, | |
222 | |
223 'conditions': [ | |
224 ['branding == "Chrome"', { | |
225 'branding_path_component%': 'google_chrome', | |
226 }], | |
227 | |
228 ['branding == "Chromium"', { | |
229 'branding_path_component%': 'chromium', | |
230 }], | |
231 | |
232 # Ash needs Aura. | |
233 ['use_aura==0', { | |
234 'use_ash%': 0, | |
235 }], | |
236 | |
237 # Set default value of toolkit_views based on OS. | |
238 ['OS=="mac" or OS=="win" or chromeos==1 or use_aura==1', { | |
239 'toolkit_views%': 1, | |
240 }, { | |
241 'toolkit_views%': 0, | |
242 }], | |
243 | |
244 # Embedded builds use aura without ash or views. | |
245 ['embedded==1', { | |
246 'use_aura%': 1, | |
247 'use_ash%': 0, | |
248 'toolkit_views%': 0, | |
249 }], | |
250 | |
251 # Chromecast builds on x86 Linux should default to desktop builds. | |
252 ['chromecast==1 and OS=="linux" and (target_arch=="ia32" or target_arc
h=="x64")', { | |
253 'is_cast_desktop_build%': 1, | |
254 }, { | |
255 'is_cast_desktop_build%': 0, | |
256 }], | |
257 | |
258 # Enable HiDPI on Mac OS, Windows and Linux (including Chrome OS). | |
259 ['OS=="mac" or OS=="win" or OS=="linux" or OS=="openbsd" or OS=="freeb
sd"', { | |
260 'enable_hidpi%': 1, | |
261 }], | |
262 | |
263 # Enable App Launcher on ChromeOS only. | |
264 ['chromeos==1', { | |
265 'enable_app_list%': 1, | |
266 }, { | |
267 'enable_app_list%': 0, | |
268 }], | |
269 | |
270 ['use_aura==1 and OS!="android"', { | |
271 'use_default_render_theme%': 1, | |
272 }, { | |
273 'use_default_render_theme%': 0, | |
274 }], | |
275 | |
276 ['use_ozone==1', { | |
277 'use_ozone_evdev%': 1, | |
278 }, { | |
279 'use_ozone_evdev%': 0, | |
280 }], | |
281 | |
282 # Set default gomadir. | |
283 ['OS=="win"', { | |
284 'gomadir': 'c:\\goma\\goma-win64', | |
285 }, { | |
286 'gomadir': '<!(/bin/echo -n ${HOME}/goma)', | |
287 }], | |
288 | |
289 # Set the default "target_subarch" on iOS. Valid values are "arm32", | |
290 # "arm64" and "both" (meaning a fat binary). | |
291 ['OS=="ios"', { | |
292 'target_subarch%': 'arm64', | |
293 }], | |
294 | |
295 # Set arch variants for MIPS platforms. | |
296 ['target_arch=="mips64el"', { | |
297 'conditions': [ | |
298 ['OS=="android"', { | |
299 'mips_arch_variant%': 'r6', | |
300 }, { | |
301 'mips_arch_variant%': 'r2', | |
302 }], | |
303 ], | |
304 }], | |
305 | |
306 ['target_arch=="mipsel"', { | |
307 'mips_arch_variant%': 'r1', | |
308 }], | |
309 | |
310 # The system root for linux builds. | |
311 ['OS=="linux" and chromeos==0 and use_sysroot==1', { | |
312 # sysroot needs to be an absolute path otherwise it generates | |
313 # incorrect results when passed to pkg-config | |
314 'conditions': [ | |
315 ['target_arch=="arm"', { | |
316 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_wheezy
_arm-sysroot', | |
317 }], | |
318 ['target_arch=="arm64"', { | |
319 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_jessie
_arm64-sysroot', | |
320 }], | |
321 ['target_arch=="x64"', { | |
322 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_wheezy
_amd64-sysroot', | |
323 }], | |
324 ['target_arch=="ia32"', { | |
325 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_wheezy
_i386-sysroot', | |
326 }], | |
327 ['target_arch=="mipsel"', { | |
328 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_wheezy
_mips-sysroot', | |
329 }], | |
330 ], | |
331 }, { | |
332 'sysroot%': '' | |
333 }], # OS=="linux" and use_sysroot==1 | |
334 ], | |
335 }, | |
336 | |
337 # Copy conditionally-set variables out one scope. | |
338 'chromeos%': '<(chromeos)', | |
339 'chromecast%': '<(chromecast)', | |
340 'is_cast_desktop_build%': '<(is_cast_desktop_build)', | |
341 'host_arch%': '<(host_arch)', | |
342 'target_arch%': '<(target_arch)', | |
343 'target_subarch%': '<(target_subarch)', | |
344 'mips_arch_variant%': '<(mips_arch_variant)', | |
345 'mips_dsp_rev%': '<(mips_dsp_rev)', | |
346 'mips_msa%': '<(mips_msa)', | |
347 'toolkit_views%': '<(toolkit_views)', | |
348 'desktop_linux%': '<(desktop_linux)', | |
349 'use_aura%': '<(use_aura)', | |
350 'use_ash%': '<(use_ash)', | |
351 'use_cras%': '<(use_cras)', | |
352 'use_libpci%': '<(use_libpci)', | |
353 'use_ozone%': '<(use_ozone)', | |
354 'use_ozone_evdev%': '<(use_ozone_evdev)', | |
355 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)', | |
356 'embedded%': '<(embedded)', | |
357 'use_openssl_certs%': '<(use_openssl_certs)', | |
358 'use_external_popup_menu%': '<(use_external_popup_menu)', | |
359 'enable_viewport%': '<(enable_viewport)', | |
360 'enable_hidpi%': '<(enable_hidpi)', | |
361 'enable_wayland_server%': '<(enable_wayland_server)', | |
362 'enable_wifi_display%': '<(enable_wifi_display)', | |
363 'android_channel%': '<(android_channel)', | |
364 'use_goma%': '<(use_goma)', | |
365 'gomadir%': '<(gomadir)', | |
366 'enable_app_list%': '<(enable_app_list)', | |
367 'use_default_render_theme%': '<(use_default_render_theme)', | |
368 'buildtype%': '<(buildtype)', | |
369 'branding%': '<(branding)', | |
370 'branding_path_component%': '<(branding_path_component)', | |
371 'arm_version%': '<(arm_version)', | |
372 'sysroot%': '<(sysroot)', | |
373 'use_sysroot%': '<(use_sysroot)', | |
374 'chroot_cmd%': '<(chroot_cmd)', | |
375 'system_libdir%': '<(system_libdir)', | |
376 'order_profiling%': '<(order_profiling)', | |
377 | |
378 # TODO(zforman): Remove as soon as no bots depend on this. | |
379 'dont_embed_build_metadata%': 0, | |
380 | |
381 # Set to 1 to force Visual C++ to use legacy debug information format /Z7. | |
382 # This is useful for parallel compilation tools which can't support /Zi. | |
383 # Only used on Windows. | |
384 'win_z7%' : 0, | |
385 | |
386 # Set to 1 to enable dcheck in Release build. | |
387 'dcheck_always_on%': 0, | |
388 | |
389 # Set to 1 to make a build that disables unshipped tracing events. | |
390 # Note: this setting is ignored if buildtype=="Official". | |
391 'tracing_like_official_build%': 0, | |
392 | |
393 # Set to 1 to make a build that disables activation of field trial tests | |
394 # specified in testing/variations/fieldtrial_testing_config_*.json. | |
395 # Note: this setting is ignored if branding=="Chrome". | |
396 'fieldtrial_testing_like_official_build%': 0, | |
397 | |
398 # Disable image loader component extension by default. | |
399 'image_loader_extension%': 0, | |
400 | |
401 # Set NEON compilation flags. | |
402 'arm_neon%': 1, | |
403 | |
404 # Detect NEON support at run-time. TODO(pasko): This variable is no longer | |
405 # set to non-zero, remove it when the last official build with NEON | |
406 # runtime detection propagates to Stable channel. | |
407 'arm_neon_optional%': 0, | |
408 | |
409 # Use libjpeg-turbo as the JPEG codec used by Chromium. | |
410 'use_libjpeg_turbo%': 1, | |
411 | |
412 # Use system libjpeg. Note that the system's libjepg will be used even if | |
413 # use_libjpeg_turbo is set. | |
414 'use_system_libjpeg%': 0, | |
415 | |
416 # By default, component is set to static_library and it can be overriden | |
417 # by the GYP command line or by ~/.gyp/include.gypi. | |
418 'component%': 'static_library', | |
419 | |
420 # /analyze is off by default on Windows because it is very slow and noisy. | |
421 # Enable with GYP_DEFINES=win_analyze=1 | |
422 'win_analyze%': 0, | |
423 | |
424 # /debug:fastlink is off by default on Windows because it generates PDBs | |
425 # that are machine-local. But, great for local builds. | |
426 # Enable with GYP_DEFINES=win_fastlink=1 | |
427 'win_fastlink%': 0, | |
428 | |
429 # Experimental setting to optimize Chrome's DLLs with PGO. | |
430 'chrome_pgo_phase%': '0', | |
431 | |
432 # Experimental setting to build the official builds with full WPO. | |
433 'full_wpo_on_official%': '0', | |
434 | |
435 # Set to select the Title Case versions of strings in GRD files. | |
436 'use_titlecase_in_grd%': 0, | |
437 | |
438 # Remoting compilation is enabled by default. Set to 0 to disable. | |
439 'remoting%': 1, | |
440 | |
441 # Configuration policy is enabled by default. Overridden on some | |
442 # platforms. This can't be disabled manually since code in src/chrome | |
443 # assumes this is enabled. | |
444 'configuration_policy': 1, | |
445 | |
446 # Variable safe_browsing is used to control the build time configuration | |
447 # for safe browsing feature. Safe browsing can be compiled in 3 different | |
448 # levels: 0 disables it, 1 enables it fully, and 2 enables mobile | |
449 # protection via an external API. | |
450 'safe_browsing%': 1, | |
451 | |
452 # Web speech is enabled by default. Set to 0 to disable. | |
453 'enable_web_speech%': 1, | |
454 | |
455 # 'Ok Google' hotwording is disabled by default. Set to 1 to enable. (This | |
456 # will download a closed-source NaCl module at startup.) Chrome-branded | |
457 # ChromeOS builds have this enabled by default. | |
458 'enable_hotwording%': 0, | |
459 | |
460 # Notifications are compiled in by default. Set to 0 to disable. | |
461 'notifications%' : 1, | |
462 | |
463 # Use dsymutil to generate real .dSYM files on Mac. The default is 0 for | |
464 # regular builds and 1 for ASan builds. | |
465 'mac_want_real_dsym%': 'default', | |
466 | |
467 # If this is set, the clang plugins used on the buildbot will be used. | |
468 # Run tools/clang/scripts/update.py to make sure they are compiled. | |
469 # This causes 'clang_chrome_plugins_flags' to be set. | |
470 # Has no effect if 'clang' is not set as well. | |
471 'clang_use_chrome_plugins%': 1, | |
472 | |
473 # Enable building with ASAN (Clang's -fsanitize=address option). | |
474 # -fsanitize=address only works with clang, but asan=1 implies clang=1 | |
475 # See https://sites.google.com/a/chromium.org/dev/developers/testing/addre
sssanitizer | |
476 'asan%': 0, | |
477 'asan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/asan/blacklist.txt', | |
478 # Enable coverage gathering instrumentation in sanitizer tools. This flag | |
479 # also controls coverage granularity. | |
480 'sanitizer_coverage%': '', | |
481 # Enable intra-object-overflow detection in ASan (experimental). | |
482 'asan_field_padding%': 0, | |
483 | |
484 # Enable Chromium overrides of the default configurations for various | |
485 # dynamic tools (like ASan). | |
486 'use_sanitizer_options%': 0, | |
487 | |
488 # Enable building with SyzyAsan. | |
489 # See https://github.com/google/syzygy/wiki/SyzyASanHowTo | |
490 'syzyasan%': 0, | |
491 | |
492 # Enable building with LSan (Clang's -fsanitize=leak option). | |
493 # -fsanitize=leak only works with clang, but lsan=1 implies clang=1 | |
494 # See https://sites.google.com/a/chromium.org/dev/developers/testing/leaks
anitizer | |
495 'lsan%': 0, | |
496 | |
497 # Enable building with TSan (Clang's -fsanitize=thread option). | |
498 # -fsanitize=thread only works with clang, but tsan=1 implies clang=1 | |
499 # See http://clang.llvm.org/docs/ThreadSanitizer.html | |
500 'tsan%': 0, | |
501 'tsan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/tsan_v2/ignores.txt'
, | |
502 | |
503 # Enable building with MSan (Clang's -fsanitize=memory option). | |
504 # MemorySanitizer only works with clang, but msan=1 implies clang=1 | |
505 # See http://clang.llvm.org/docs/MemorySanitizer.html | |
506 'msan%': 0, | |
507 'msan_blacklist%': '<(PRODUCT_DIR)/../../tools/msan/blacklist.txt', | |
508 # Track where uninitialized memory originates from. From fastest to | |
509 # slowest: 0 - no tracking, 1 - track only the initial allocation site, 2 | |
510 # - track the chain of stores leading from allocation site to use site. | |
511 'msan_track_origins%': 2, | |
512 | |
513 # Enable building with UBSan (Clang's -fsanitize=undefined option). | |
514 # -fsanitize=undefined only works with clang, but ubsan=1 implies clang=1 | |
515 # See http://clang.llvm.org/docs/UsersManual.html | |
516 'ubsan%': 0, | |
517 'ubsan_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan/blacklist.txt', | |
518 'ubsan_security_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan/security_bl
acklist.txt', | |
519 'ubsan_vptr_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan/vptr_blacklist.
txt', | |
520 | |
521 # Enable building with UBsan's vptr (Clang's -fsanitize=vptr option). | |
522 # -fsanitize=vptr only works with clang, but ubsan_vptr=1 implies clang=1 | |
523 # ubsan_security also enables UBSan's vptr. | |
524 'ubsan_security%': 0, | |
525 'ubsan_vptr%': 0, | |
526 | |
527 # Use dynamic libraries instrumented by one of the sanitizers | |
528 # instead of the standard system libraries. Set this flag to build the | |
529 # libraries from source. | |
530 'use_instrumented_libraries%': 0, | |
531 | |
532 # Use dynamic libraries instrumented by one of the sanitizers | |
533 # instead of the standard system libraries. Set this flag to download | |
534 # prebuilt binaries from GCS. | |
535 'use_prebuilt_instrumented_libraries%': 0, | |
536 | |
537 # Use libc++ (third_party/libc++ and third_party/libc++abi) instead of | |
538 # stdlibc++ as standard library. This is intended to use for instrumented | |
539 # builds. | |
540 'use_custom_libcxx%': 0, | |
541 | |
542 # Use the provided profiled order file to link Chrome image with it. | |
543 # This makes Chrome faster by better using CPU cache when executing code. | |
544 # This is known as PGO (profile guided optimization). | |
545 # See https://sites.google.com/a/google.com/chrome-msk/dev/boot-speed-up-e
ffort | |
546 'order_text_section%' : "", | |
547 | |
548 # Set to 1 compile with -fPIC cflag on linux. This is a must for shared | |
549 # libraries on linux x86-64 and arm, plus ASLR. | |
550 'linux_fpic%': 1, | |
551 | |
552 # Whether one-click signin is enabled or not. | |
553 'enable_one_click_signin%': 0, | |
554 | |
555 # Enable Chrome browser extensions | |
556 'enable_extensions%': 1, | |
557 | |
558 # Enable basic printing support and UI. | |
559 'enable_basic_printing%': 1, | |
560 | |
561 # Enable printing with print preview. It does not imply | |
562 # enable_basic_printing. It's possible to build Chrome with preview only. | |
563 'enable_print_preview%': 1, | |
564 | |
565 # For CLD2, the size of the tables that should be included in the build | |
566 # See third_party/cld_2/cld_2.gyp for more information. | |
567 # 0: Small tables, high accuracy | |
568 # 2: Large tables, higher accuracy | |
569 'cld2_table_size%': 2, | |
570 | |
571 # Enable spell checker. | |
572 'enable_spellcheck%': 1, | |
573 | |
574 # Use the operating system spellchecker, e.g. NSSpellChecker on Mac or | |
575 # SpellCheckerSession on Android. | |
576 'use_browser_spellchecker%': 0, | |
577 | |
578 # Use Minikin hyphenation engine. | |
579 'use_minikin_hyphenation%': 0, | |
580 | |
581 # Webrtc compilation is enabled by default. Set to 0 to disable. | |
582 'enable_webrtc%': 1, | |
583 | |
584 # Media router support is enabled by default. Set to 0 to disable. | |
585 'enable_media_router%': 1, | |
586 | |
587 # Enables use of the session service, which is enabled by default. | |
588 # Support for disabling depends on the platform. | |
589 'enable_session_service%': 1, | |
590 | |
591 # Enables theme support, which is enabled by default. Support for | |
592 # disabling depends on the platform. | |
593 'enable_themes%': 1, | |
594 | |
595 # Enable the task manager by default. | |
596 'enable_task_manager%': 1, | |
597 | |
598 # Enables used resource whitelist generation; disabled by default. | |
599 'enable_resource_whitelist_generation%': 0, | |
600 | |
601 # Enable FILE support by default. | |
602 'disable_file_support%': 0, | |
603 | |
604 # Enable FTP support by default. | |
605 'disable_ftp_support%': 0, | |
606 | |
607 # Do not use the platform ICU alternatives by default. | |
608 'use_platform_icu_alternatives%': 0, | |
609 | |
610 # Do not disable brotli filter by default. | |
611 'disable_brotli_filter%': 0, | |
612 | |
613 # Use of precompiled headers on Windows. | |
614 # | |
615 # This variable may be explicitly set to 1 (enabled) or 0 | |
616 # (disabled) in ~/.gyp/include.gypi or via the GYP command line. | |
617 # This setting will override the default. | |
618 # | |
619 # See | |
620 # https://chromium.googlesource.com/chromium/src/+/master/docs/windows_pre
compiled_headers.md | |
621 # for details. | |
622 'chromium_win_pch%': 0, | |
623 | |
624 # Clang stuff. | |
625 'make_clang_dir%': 'third_party/llvm-build/Release+Asserts', | |
626 # Set this to true when building with Clang. | |
627 # See https://chromium.googlesource.com/chromium/src/+/master/docs/clang.m
d for details. | |
628 # If this is set, clang is used as both host and target compiler in | |
629 # cross-compile builds. | |
630 'clang%': 0, | |
631 | |
632 # Use experimental lld linker instead of the platform's default linker. | |
633 'use_lld%': 0, | |
634 | |
635 # Enable plugin installation by default. | |
636 'enable_plugin_installation%': 1, | |
637 | |
638 # Specifies whether to use canvas_skia.cc in place of platform | |
639 # specific implementations of gfx::Canvas. Affects text drawing in the | |
640 # Chrome UI. | |
641 # TODO(asvitkine): Enable this on all platforms and delete this flag. | |
642 # http://crbug.com/105550 | |
643 'use_canvas_skia%': 0, | |
644 | |
645 # Set to "drmemory" to configure the build to work with DrMemory. | |
646 'build_for_tool%': '', | |
647 | |
648 'wix_path%': '<(DEPTH)/third_party/wix', | |
649 | |
650 # Supervised users are enabled by default. | |
651 'enable_supervised_users%': 1, | |
652 | |
653 'enable_mdns%' : 0, | |
654 'enable_service_discovery%': 0, | |
655 'enable_hangout_services_extension%': 0, | |
656 | |
657 # Enable the Syzygy optimization step. | |
658 'syzygy_optimize%': 0, | |
659 | |
660 # Automatically select platforms under ozone. Turn this off to | |
661 # build only explicitly selected platforms. | |
662 'ozone_auto_platforms%': 1, | |
663 | |
664 # Disable the display for a chromecast build. Set to 1 perform an audio- | |
665 # only build. | |
666 'disable_display%': 0, | |
667 | |
668 # If this is set clang is used as host compiler, but not as target | |
669 # compiler. Always do this by default. | |
670 'host_clang%': 1, | |
671 | |
672 # Variables to control Link-Time Optimization (LTO). | |
673 # On Android, when using GCC LTO, the variable use_lto enables LTO on code | |
674 # compiled with -Os, and use_lto_o2 enables LTO on code compiled with -O2. | |
675 # On other platforms (including Android with Clang), use_lto enables LTO | |
676 # in all translation units, and use_lto_o2 has no effect. | |
677 # | |
678 # On Linux and Android, when using LLVM LTO, the script | |
679 # build/download_gold_plugin.py must be run to download a linker plugin. | |
680 # On Mac, LLVM needs to be built from scratch using | |
681 # tools/clang/scripts/update.py and the absolute path to | |
682 # third_party/llvm-build/Release+Asserts/lib must be added to | |
683 # $DYLD_LIBRARY_PATH to pick up the right version of the linker plugin. | |
684 # TODO(pcc): Teach build system to use -lto_library flag to specify path | |
685 # to linker plugin on Mac. | |
686 # | |
687 # On Android/GCC, the variables must *not* be enabled at the same time. | |
688 # In this case LTO would 'merge' the optimization flags at link-time | |
689 # which would lead to all code be optimized with -O2. See crbug.com/407544 | |
690 'use_lto%': 0, | |
691 'use_lto_o2%': 0, | |
692 | |
693 # Allowed level of identical code folding in the gold linker. | |
694 'gold_icf_level%': 'all', | |
695 | |
696 # Libxkbcommon usage. | |
697 'use_xkbcommon%': 0, | |
698 | |
699 # Whether we use GTKv3 on linux. | |
700 'use_gtk3%': 0, | |
701 | |
702 # Control Flow Integrity for virtual calls and casts. | |
703 # See http://clang.llvm.org/docs/ControlFlowIntegrity.html | |
704 'cfi_vptr%': 0, | |
705 # TODO(krasin): remove it. See https://crbug.com/626794. | |
706 'cfi_cast%': 0, | |
707 'cfi_diag%': 0, | |
708 | |
709 'cfi_blacklist%': '<(PRODUCT_DIR)/../../tools/cfi/blacklist.txt', | |
710 | |
711 # Whether the entire browser uses toolkit-views on Mac instead of Cocoa. | |
712 'mac_views_browser%': 0, | |
713 | |
714 # By default, use ICU data file (icudtl.dat). | |
715 'icu_use_data_file_flag%': 1, | |
716 | |
717 # Turn on JNI generation optimizations by default. | |
718 'optimize_jni_generation%': 1, | |
719 | |
720 'conditions': [ | |
721 # A flag for POSIX platforms | |
722 ['OS=="win"', { | |
723 'os_posix%': 0, | |
724 }, { | |
725 'os_posix%': 1, | |
726 }], | |
727 | |
728 # A flag for BSD platforms | |
729 ['OS=="freebsd" or OS=="openbsd"', { | |
730 'os_bsd%': 1, | |
731 }, { | |
732 'os_bsd%': 0, | |
733 }], | |
734 | |
735 # NSS usage. | |
736 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris")', { | |
737 'use_nss_certs%': 1, | |
738 }, { | |
739 'use_nss_certs%': 0, | |
740 }], | |
741 | |
742 # libudev usage. This currently only affects the content layer. | |
743 ['OS=="linux" and embedded==0', { | |
744 'use_udev%': 1, | |
745 }, { | |
746 'use_udev%': 0, | |
747 }], | |
748 | |
749 # Flags to use X11 on non-Mac POSIX platforms. | |
750 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1',
{ | |
751 'use_x11%': 0, | |
752 }, { | |
753 'use_x11%': 1, | |
754 }], | |
755 | |
756 # Flags to use glib. | |
757 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1',
{ | |
758 'use_glib%': 0, | |
759 }, { | |
760 'use_glib%': 1, | |
761 }], | |
762 | |
763 # Flags to use Wayland server support. | |
764 ['chromeos==1', { | |
765 'enable_wayland_server%': 1, | |
766 }, { | |
767 'enable_wayland_server%': 0, | |
768 }], | |
769 | |
770 # Flags to use pango and cairo. | |
771 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or embedded==1',
{ | |
772 'use_pango%': 0, | |
773 'use_cairo%': 0, | |
774 }, { | |
775 'use_pango%': 1, | |
776 'use_cairo%': 1, | |
777 }], | |
778 | |
779 # DBus usage. | |
780 ['(OS=="linux" or OS=="openbsd" or OS=="freebsd") and embedded==0', { | |
781 'use_dbus%': 1, | |
782 }, { | |
783 'use_dbus%': 0, | |
784 }], | |
785 | |
786 # We always use skia text rendering in Aura on Windows, since GDI | |
787 # doesn't agree with our BackingStore. | |
788 # TODO(beng): remove once skia text rendering is on by default. | |
789 ['use_aura==1 and OS=="win"', { | |
790 'enable_skia_text%': 1, | |
791 }], | |
792 | |
793 # A flag to enable or disable our compile-time dependency | |
794 # on gnome-keyring. If that dependency is disabled, no gnome-keyring | |
795 # support will be available. This option is useful | |
796 # for Linux distributions and for Aura. | |
797 ['OS!="linux" or chromeos==1', { | |
798 'use_gnome_keyring%': 0, | |
799 }, { | |
800 'use_gnome_keyring%': 1, | |
801 }], | |
802 | |
803 ['OS=="mac" or OS=="ios"', { | |
804 # Mac and iOS want Title Case strings | |
805 'use_titlecase_in_grd%': 1, | |
806 }], | |
807 | |
808 # Enable loader extensions on Chrome OS. | |
809 ['chromeos==1', { | |
810 'image_loader_extension%': 1, | |
811 }, { | |
812 'image_loader_extension%': 0, | |
813 }], | |
814 | |
815 ['OS=="win" or OS=="mac" or (OS=="linux" and chromeos==0)', { | |
816 'enable_one_click_signin%': 1, | |
817 }], | |
818 | |
819 ['OS=="android"', { | |
820 'enable_extensions%': 0, | |
821 'cld2_table_size%': 0, | |
822 'enable_themes%': 0, | |
823 'remoting%': 0, | |
824 'enable_basic_printing%': 1, | |
825 'enable_print_preview%': 0, | |
826 'enable_task_manager%':0, | |
827 }], | |
828 | |
829 # Android and OSX have built-in spellcheckers that can be utilized. | |
830 ['OS=="android" or OS=="mac"', { | |
831 'use_browser_spellchecker%': 1, | |
832 }], | |
833 | |
834 # Android has hyphenation dictionaries for Minikin to use. | |
835 ['OS=="android"', { | |
836 'use_minikin_hyphenation%': 1, | |
837 }], | |
838 | |
839 # Enables proprietary codecs and demuxers; e.g. H264, AAC, MP3, and MP4. | |
840 # We always build Google Chrome and Chromecast with proprietary codecs. | |
841 ['branding=="Chrome" or chromecast==1', { | |
842 'proprietary_codecs%': 1, | |
843 }, { | |
844 'proprietary_codecs%': 0, | |
845 }], | |
846 | |
847 # Enable Link Time Optimization for the official Linux Chrome. | |
848 # This requires LLVM Gold plugin to be downloaded. | |
849 # See src/tools/clang/scripts/update.py | |
850 ['OS=="linux" and target_arch=="x64" and buildtype=="Official" and brand
ing=="Chrome" and chromeos==0', { | |
851 'use_lto%': 1, | |
852 }], | |
853 | |
854 # Enable hotwording on Chrome-branded ChromeOS builds. | |
855 ['branding=="Chrome" and chromeos==1', { | |
856 'enable_hotwording%': 1, | |
857 }], | |
858 | |
859 ['OS=="android"', { | |
860 'enable_webrtc%': 1, | |
861 }], | |
862 | |
863 ['OS=="ios"', { | |
864 'configuration_policy': 0, | |
865 'disable_ftp_support%': 1, | |
866 'enable_extensions%': 0, | |
867 'cld2_table_size%': 0, | |
868 'enable_basic_printing%': 0, | |
869 'enable_print_preview%': 0, | |
870 'enable_session_service%': 0, | |
871 'enable_spellcheck%': 0, | |
872 'enable_themes%': 0, | |
873 'enable_webrtc%': 0, | |
874 'notifications%': 0, | |
875 'remoting%': 0, | |
876 'safe_browsing%': 2, | |
877 'enable_supervised_users%': 0, | |
878 'enable_task_manager%': 0, | |
879 'enable_media_router%': 0, | |
880 }], | |
881 | |
882 # Use GPU accelerated cross process image transport by default | |
883 # on linux and *BSD builds with the Aura window manager | |
884 ['use_aura==1 and (OS=="linux" or OS=="openbsd" or OS=="freebsd")', { | |
885 'ui_compositor_image_transport%': 1, | |
886 }, { | |
887 'ui_compositor_image_transport%': 0, | |
888 }], | |
889 | |
890 # Turn precompiled headers on by default. | |
891 ['OS=="win" and buildtype!="Official"', { | |
892 'chromium_win_pch%': 1 | |
893 }], | |
894 | |
895 # Whether PDF plugin is enabled, and which options it supports. | |
896 ['OS=="android" or OS=="ios" or (embedded==1 and chromecast==0)', { | |
897 'enable_pdf%': 0, | |
898 'pdf_enable_v8%': 0, | |
899 }, { | |
900 'enable_pdf%': 1, | |
901 'pdf_enable_v8%': 1, | |
902 }], | |
903 ['OS=="android" or OS=="ios" or (embedded==1 and chromecast==0)', { | |
904 'pdf_enable_xfa%': 0, | |
905 }, { | |
906 'pdf_enable_xfa%': 0, | |
907 }], | |
908 | |
909 ['chromeos==1 or OS=="android" or OS=="ios" or desktop_linux==1', { | |
910 'enable_plugin_installation%': 0, | |
911 }, { | |
912 'enable_plugin_installation%': 1, | |
913 }], | |
914 | |
915 # Whether PPAPI is enabled. | |
916 ['OS=="android" or OS=="ios" or (embedded==1 and chromecast==0)', { | |
917 'enable_plugins%': 0, | |
918 }, { | |
919 'enable_plugins%': 1, | |
920 }], | |
921 | |
922 # linux_use_bundled_gold: whether to use the gold linker binary checked | |
923 # into third_party/binutils. Force this off via GYP_DEFINES when you | |
924 # are using a custom toolchain and need to control -B in ldflags. | |
925 # Do not use 32-bit gold on 32-bit hosts as it runs out address space | |
926 # for component=static_library builds. | |
927 ['((OS=="linux" or OS=="android") and (target_arch=="x64" or target_arch
=="arm" or (target_arch=="ia32" and host_arch=="x64"))) or (OS=="linux" and targ
et_arch=="mipsel")', { | |
928 'linux_use_bundled_gold%': 1, | |
929 }, { | |
930 'linux_use_bundled_gold%': 0, | |
931 }], | |
932 | |
933 # linux_use_bundled_binutils: whether to use the binary binutils | |
934 # checked into third_party/binutils. These are not multi-arch so cannot | |
935 # be used except on x86 and x86-64 (the only two architectures which | |
936 # are currently checke in). Force this off via GYP_DEFINES when you | |
937 # are using a custom toolchain and need to control -B in cflags. | |
938 ['OS=="linux" and (target_arch=="x64")', { | |
939 'linux_use_bundled_binutils%': 1, | |
940 }, { | |
941 'linux_use_bundled_binutils%': 0, | |
942 }], | |
943 | |
944 # linux_use_gold_flags: whether to use build flags that rely on gold. | |
945 # On by default for x64 Linux. | |
946 ['OS=="linux" and target_arch=="x64"', { | |
947 'linux_use_gold_flags%': 1, | |
948 }, { | |
949 'linux_use_gold_flags%': 0, | |
950 }], | |
951 | |
952 # linux_use_debug_fission: whether to use split DWARF debug info | |
953 # files. This can reduce link time significantly, but is incompatible | |
954 # with some utilities such as icecc and ccache. Requires gold and | |
955 # gcc >= 4.8 or clang. | |
956 # http://gcc.gnu.org/wiki/DebugFission | |
957 ['OS=="linux" and target_arch=="x64"', { | |
958 'linux_use_debug_fission%': 1, | |
959 }, { | |
960 'linux_use_debug_fission%': 0, | |
961 }], | |
962 | |
963 ['OS=="android" or OS=="ios"', { | |
964 'enable_captive_portal_detection%': 0, | |
965 }, { | |
966 'enable_captive_portal_detection%': 1, | |
967 }], | |
968 | |
969 # Enable Skia UI text drawing incrementally on different platforms. | |
970 # http://crbug.com/105550 | |
971 # | |
972 # On Aura, this allows per-tile painting to be used in the browser | |
973 # compositor. | |
974 ['OS!="android" and OS!="ios"', { | |
975 'use_canvas_skia%': 1, | |
976 }], | |
977 | |
978 ['chromeos==1', { | |
979 'enable_basic_printing%': 1, | |
980 'enable_print_preview%': 1, | |
981 }], | |
982 | |
983 # Whether tests targets should be run, archived or just have the | |
984 # dependencies verified. All the tests targets have the '_run' suffix, | |
985 # e.g. base_unittests_run runs the target base_unittests. The test | |
986 # target always calls tools/swarming_client/isolate.py. See the script's | |
987 # --help for more information. Meant to be overriden with GYP_DEFINES. | |
988 # TODO(maruel): Remove the conditions as more configurations are | |
989 # supported. | |
990 ['OS!="ios" and OS!="android" and chromeos==0 and OS!="openbsd" and OS!=
"freebsd"', { | |
991 'test_isolation_mode%': 'check', | |
992 }, { | |
993 'test_isolation_mode%': 'noop', | |
994 }], | |
995 # Whether Android build uses OpenMAX DL FFT. | |
996 ['OS=="android" and ((target_arch=="arm" and arm_version >= 7) or target
_arch=="ia32" or target_arch=="x64" or target_arch=="arm64" or target_arch=="mip
sel")', { | |
997 # Currently only supported on Android ARMv7+, ARM64, ia32, x64 and mip
sel. | |
998 # When enabled, this will also enable WebAudio support on | |
999 # Android for these architectures. Default is enabled. Whether | |
1000 # WebAudio is actually available depends on runtime settings | |
1001 # and flags. | |
1002 'use_openmax_dl_fft%': 1, | |
1003 }, { | |
1004 'use_openmax_dl_fft%': 0, | |
1005 }], | |
1006 ['OS=="win" or OS=="linux" or OS=="openbsd" or OS=="freebsd"', { | |
1007 'enable_mdns%' : 1, | |
1008 }], | |
1009 | |
1010 # Disable various features by default on embedded. | |
1011 ['embedded==1', { | |
1012 'remoting%': 0, | |
1013 'enable_basic_printing%': 0, | |
1014 'enable_print_preview%': 0, | |
1015 }], | |
1016 | |
1017 ['sysroot!=""', { | |
1018 'pkg-config': '<(chroot_cmd) <(DEPTH)/build/linux/pkg-config-wrapper "
<(sysroot)" "<(target_arch)" "<(system_libdir)"', | |
1019 }, { | |
1020 'pkg-config': 'pkg-config' | |
1021 }], | |
1022 | |
1023 # Enable WebVR support by default on Android | |
1024 # Still requires command line flag to access API | |
1025 ['OS=="android"', { | |
1026 'enable_webvr%': 1, | |
1027 }, { | |
1028 'enable_webvr%': 0, | |
1029 }], | |
1030 | |
1031 ['order_profiling==0', { | |
1032 # Set to 1 to enable fast builds. Set to 2 for even faster builds | |
1033 # (it disables debug info for fastest compilation - only for use | |
1034 # on compile-only bots). | |
1035 'fastbuild%': 0, | |
1036 }, { | |
1037 # With instrumentation enabled, debug info puts libchrome.so over 4gb, | |
1038 # which causes the linker to produce an invalid ELF. | |
1039 # http://crbug.com/574476 | |
1040 'fastbuild%': 2, | |
1041 }], | |
1042 ], | |
1043 | |
1044 # Kasko reporting is disabled by default, but may get enabled below. | |
1045 'kasko%': 0, | |
1046 | |
1047 # Setting this to '0' will cause V8's startup snapshot to be | |
1048 # embedded in the binary instead of being a external files. | |
1049 'v8_use_external_startup_data%': 1, | |
1050 | |
1051 # Set this to 1 to enable use of concatenated impulse responses | |
1052 # for the HRTF panner in WebAudio. | |
1053 'use_concatenated_impulse_responses': 1, | |
1054 | |
1055 # You can set the variable 'use_official_google_api_keys' to 1 | |
1056 # to use the Google-internal file containing official API keys | |
1057 # for Google Chrome even in a developer build. Setting this | |
1058 # variable explicitly to 1 will cause your build to fail if the | |
1059 # internal file is missing. | |
1060 # | |
1061 # The variable is documented here, but not handled in this file; | |
1062 # see //google_apis/determine_use_official_keys.gypi for the | |
1063 # implementation. | |
1064 # | |
1065 # Set the variable to 0 to not use the internal file, even when | |
1066 # it exists in your checkout. | |
1067 # | |
1068 # Leave it unset in your include.gypi to have the variable | |
1069 # implicitly set to 1 if you have | |
1070 # src/google_apis/internal/google_chrome_api_keys.h in your | |
1071 # checkout, and implicitly set to 0 if not. | |
1072 # | |
1073 # Note that official builds always behave as if the variable | |
1074 # was explicitly set to 1, i.e. they always use official keys, | |
1075 # and will fail to build if the internal file is missing. | |
1076 # | |
1077 # NOTE: You MUST NOT explicitly set the variable to 2 in your | |
1078 # include.gypi or by other means. Due to subtleties of GYP, this | |
1079 # is not the same as leaving the variable unset, even though its | |
1080 # default value in | |
1081 # //google_apis/determine_use_official_keys.gypi is 2. | |
1082 | |
1083 # Set these to bake the specified API keys and OAuth client | |
1084 # IDs/secrets into your build. | |
1085 # | |
1086 # If you create a build without values baked in, you can instead | |
1087 # set environment variables to provide the keys at runtime (see | |
1088 # src/google_apis/google_api_keys.h for details). Features that | |
1089 # require server-side APIs may fail to work if no keys are | |
1090 # provided. | |
1091 # | |
1092 # Note that if you are building an official build or if | |
1093 # use_official_google_api_keys has been set to 1 (explicitly or | |
1094 # implicitly), these values will be ignored and the official | |
1095 # keys will be used instead. | |
1096 'google_api_key%': '', | |
1097 'google_default_client_id%': '', | |
1098 'google_default_client_secret%': '', | |
1099 # Native Client is enabled by default. | |
1100 'disable_nacl%': '0', | |
1101 | |
1102 # Native Client toolchains, enabled by default. | |
1103 'disable_pnacl%': 0, | |
1104 'disable_newlib%': 0, | |
1105 | |
1106 # Sets the default version name and code for Android app, by default we | |
1107 # do a developer build. | |
1108 'android_app_version_name%': 'Developer Build', | |
1109 'android_app_version_code%': 1, | |
1110 | |
1111 # Use the internal version of the framework to build Android WebView. | |
1112 'use_webview_internal_framework%': 0, | |
1113 }, | |
1114 | |
1115 # Copy conditionally-set variables out one scope. | |
1116 'branding%': '<(branding)', | |
1117 'branding_path_component%': '<(branding_path_component)', | |
1118 'buildtype%': '<(buildtype)', | |
1119 'target_arch%': '<(target_arch)', | |
1120 'target_subarch%': '<(target_subarch)', | |
1121 'mips_arch_variant%': '<(mips_arch_variant)', | |
1122 'mips_dsp_rev%': '<(mips_dsp_rev)', | |
1123 'mips_msa%': '<(mips_msa)', | |
1124 'host_arch%': '<(host_arch)', | |
1125 'toolkit_views%': '<(toolkit_views)', | |
1126 'ui_compositor_image_transport%': '<(ui_compositor_image_transport)', | |
1127 'use_aura%': '<(use_aura)', | |
1128 'use_ash%': '<(use_ash)', | |
1129 'use_cras%': '<(use_cras)', | |
1130 'use_libpci%': '<(use_libpci)', | |
1131 'use_openssl_certs%': '<(use_openssl_certs)', | |
1132 'use_external_popup_menu%': '<(use_external_popup_menu)', | |
1133 'use_nss_certs%': '<(use_nss_certs)', | |
1134 'use_udev%': '<(use_udev)', | |
1135 'os_bsd%': '<(os_bsd)', | |
1136 'os_posix%': '<(os_posix)', | |
1137 'use_dbus%': '<(use_dbus)', | |
1138 'use_glib%': '<(use_glib)', | |
1139 'use_pango%': '<(use_pango)', | |
1140 'use_cairo%': '<(use_cairo)', | |
1141 'use_ozone%': '<(use_ozone)', | |
1142 'use_ozone_evdev%': '<(use_ozone_evdev)', | |
1143 'use_xkbcommon%': '<(use_xkbcommon)', | |
1144 'use_gtk3%': '<(use_gtk3)', | |
1145 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)', | |
1146 'desktop_linux%': '<(desktop_linux)', | |
1147 'use_x11%': '<(use_x11)', | |
1148 'use_gnome_keyring%': '<(use_gnome_keyring)', | |
1149 'linux_fpic%': '<(linux_fpic)', | |
1150 'chromeos%': '<(chromeos)', | |
1151 'chromecast%': '<(chromecast)', | |
1152 'is_cast_desktop_build%': '<(is_cast_desktop_build)', | |
1153 'enable_viewport%': '<(enable_viewport)', | |
1154 'enable_hidpi%': '<(enable_hidpi)', | |
1155 'enable_wayland_server%': '<(enable_wayland_server)', | |
1156 'enable_wifi_display%': '<(enable_wifi_display)', | |
1157 'image_loader_extension%': '<(image_loader_extension)', | |
1158 'fastbuild%': '<(fastbuild)', | |
1159 'win_z7%': '<(win_z7)', | |
1160 'dcheck_always_on%': '<(dcheck_always_on)', | |
1161 'tracing_like_official_build%': '<(tracing_like_official_build)', | |
1162 'fieldtrial_testing_like_official_build%': '<(fieldtrial_testing_like_offici
al_build)', | |
1163 'arm_version%': '<(arm_version)', | |
1164 'arm_neon%': '<(arm_neon)', | |
1165 'arm_neon_optional%': '<(arm_neon_optional)', | |
1166 'sysroot%': '<(sysroot)', | |
1167 'use_sysroot%': '<(use_sysroot)', | |
1168 'pkg-config%': '<(pkg-config)', | |
1169 'chroot_cmd%': '<(chroot_cmd)', | |
1170 'system_libdir%': '<(system_libdir)', | |
1171 'component%': '<(component)', | |
1172 'win_analyze%': '<(win_analyze)', | |
1173 'win_fastlink%': '<(win_fastlink)', | |
1174 'chrome_pgo_phase%': '<(chrome_pgo_phase)', | |
1175 'full_wpo_on_official%': '<(full_wpo_on_official)', | |
1176 'enable_resource_whitelist_generation%': '<(enable_resource_whitelist_genera
tion)', | |
1177 'use_titlecase_in_grd%': '<(use_titlecase_in_grd)', | |
1178 'remoting%': '<(remoting)', | |
1179 'enable_one_click_signin%': '<(enable_one_click_signin)', | |
1180 'enable_media_router%': '<(enable_media_router)', | |
1181 'enable_webrtc%': '<(enable_webrtc)', | |
1182 'chromium_win_pch%': '<(chromium_win_pch)', | |
1183 'configuration_policy': '<(configuration_policy)', | |
1184 'safe_browsing%': '<(safe_browsing)', | |
1185 'enable_web_speech%': '<(enable_web_speech)', | |
1186 'enable_hotwording%': '<(enable_hotwording)', | |
1187 'notifications%': '<(notifications)', | |
1188 'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)', | |
1189 'mac_want_real_dsym%': '<(mac_want_real_dsym)', | |
1190 'asan%': '<(asan)', | |
1191 'asan_blacklist%': '<(asan_blacklist)', | |
1192 'sanitizer_coverage%': '<(sanitizer_coverage)', | |
1193 'asan_field_padding%': '<(asan_field_padding)', | |
1194 'use_sanitizer_options%': '<(use_sanitizer_options)', | |
1195 'syzyasan%': '<(syzyasan)', | |
1196 'kasko%': '<(kasko)', | |
1197 'syzygy_optimize%': '<(syzygy_optimize)', | |
1198 'lsan%': '<(lsan)', | |
1199 'msan%': '<(msan)', | |
1200 'msan_blacklist%': '<(msan_blacklist)', | |
1201 'msan_track_origins%': '<(msan_track_origins)', | |
1202 'tsan%': '<(tsan)', | |
1203 'tsan_blacklist%': '<(tsan_blacklist)', | |
1204 'ubsan%': '<(ubsan)', | |
1205 'ubsan_blacklist%': '<(ubsan_blacklist)', | |
1206 'ubsan_security%': '<(ubsan_security)', | |
1207 'ubsan_security_blacklist%': '<(ubsan_security_blacklist)', | |
1208 'ubsan_vptr%': '<(ubsan_vptr)', | |
1209 'ubsan_vptr_blacklist%': '<(ubsan_vptr_blacklist)', | |
1210 'use_instrumented_libraries%': '<(use_instrumented_libraries)', | |
1211 'use_prebuilt_instrumented_libraries%': '<(use_prebuilt_instrumented_librari
es)', | |
1212 'use_custom_libcxx%': '<(use_custom_libcxx)', | |
1213 'order_profiling%': '<(order_profiling)', | |
1214 'order_text_section%': '<(order_text_section)', | |
1215 'enable_extensions%': '<(enable_extensions)', | |
1216 'enable_pdf%': '<(enable_pdf)', | |
1217 'pdf_enable_v8%': '<(pdf_enable_v8)', | |
1218 'pdf_enable_xfa%': '<(pdf_enable_xfa)', | |
1219 'enable_plugin_installation%': '<(enable_plugin_installation)', | |
1220 'enable_plugins%': '<(enable_plugins)', | |
1221 'enable_session_service%': '<(enable_session_service)', | |
1222 'enable_themes%': '<(enable_themes)', | |
1223 'linux_use_bundled_gold%': '<(linux_use_bundled_gold)', | |
1224 'linux_use_bundled_binutils%': '<(linux_use_bundled_binutils)', | |
1225 'linux_use_gold_flags%': '<(linux_use_gold_flags)', | |
1226 'linux_use_debug_fission%': '<(linux_use_debug_fission)', | |
1227 'use_canvas_skia%': '<(use_canvas_skia)', | |
1228 'test_isolation_mode%': '<(test_isolation_mode)', | |
1229 'enable_basic_printing%': '<(enable_basic_printing)', | |
1230 'enable_print_preview%': '<(enable_print_preview)', | |
1231 'enable_spellcheck%': '<(enable_spellcheck)', | |
1232 'use_browser_spellchecker%': '<(use_browser_spellchecker)', | |
1233 'use_minikin_hyphenation%': '<(use_minikin_hyphenation)', | |
1234 'cld2_table_size%': '<(cld2_table_size)', | |
1235 'enable_captive_portal_detection%': '<(enable_captive_portal_detection)', | |
1236 'disable_file_support%': '<(disable_file_support)', | |
1237 'disable_ftp_support%': '<(disable_ftp_support)', | |
1238 'use_platform_icu_alternatives%': '<(use_platform_icu_alternatives)', | |
1239 'disable_brotli_filter%': '<(disable_brotli_filter)', | |
1240 'enable_task_manager%': '<(enable_task_manager)', | |
1241 'wix_path%': '<(wix_path)', | |
1242 'use_libjpeg_turbo%': '<(use_libjpeg_turbo)', | |
1243 'use_system_libjpeg%': '<(use_system_libjpeg)', | |
1244 'android_channel%': '<(android_channel)', | |
1245 'icu_use_data_file_flag%': '<(icu_use_data_file_flag)', | |
1246 'gyp_managed_install%': 0, | |
1247 'create_standalone_apk%': 1, | |
1248 'enable_app_list%': '<(enable_app_list)', | |
1249 'use_default_render_theme%': '<(use_default_render_theme)', | |
1250 'google_api_key%': '<(google_api_key)', | |
1251 'google_default_client_id%': '<(google_default_client_id)', | |
1252 'google_default_client_secret%': '<(google_default_client_secret)', | |
1253 'enable_supervised_users%': '<(enable_supervised_users)', | |
1254 'enable_mdns%' : '<(enable_mdns)', | |
1255 'enable_service_discovery%' : '<(enable_service_discovery)', | |
1256 'enable_hangout_services_extension%' : '<(enable_hangout_services_extension)
', | |
1257 'proprietary_codecs%': '<(proprietary_codecs)', | |
1258 'use_goma%': '<(use_goma)', | |
1259 'gomadir%': '<(gomadir)', | |
1260 'use_lto%': '<(use_lto)', | |
1261 'use_lto_o2%': '<(use_lto_o2)', | |
1262 'gold_icf_level%': '<(gold_icf_level)', | |
1263 'v8_use_external_startup_data%': '<(v8_use_external_startup_data)', | |
1264 'cfi_vptr%': '<(cfi_vptr)', | |
1265 'cfi_cast%': '<(cfi_cast)', | |
1266 'cfi_diag%': '<(cfi_diag)', | |
1267 'cfi_blacklist%': '<(cfi_blacklist)', | |
1268 'mac_views_browser%': '<(mac_views_browser)', | |
1269 'android_app_version_name%': '<(android_app_version_name)', | |
1270 'android_app_version_code%': '<(android_app_version_code)', | |
1271 'use_webview_internal_framework%': '<(use_webview_internal_framework)', | |
1272 'enable_webvr%': '<(enable_webvr)', | |
1273 | |
1274 # Turns on compiler optimizations in V8 in Debug build. | |
1275 'v8_optimized_debug%': 1, | |
1276 | |
1277 # Use system protobuf instead of bundled one. | |
1278 'use_system_protobuf%': 0, | |
1279 | |
1280 # Use system yasm instead of bundled one. | |
1281 'use_system_yasm%': 0, | |
1282 | |
1283 # Use system ICU instead of bundled one. | |
1284 'use_system_icu%' : 0, | |
1285 | |
1286 # Default to enabled PIE; this is important for ASLR but we may need to be | |
1287 # able to turn it off for various reasons. | |
1288 'linux_disable_pie%': 0, | |
1289 | |
1290 # The release channel that this build targets. This is used to restrict | |
1291 # channel-specific build options, like which installer packages to create. | |
1292 # The default is 'all', which does no channel-specific filtering. | |
1293 'channel%': 'all', | |
1294 | |
1295 # Override chromium_mac_pch and set it to 0 to suppress the use of | |
1296 # precompiled headers on the Mac. Prefix header injection may still be | |
1297 # used, but prefix headers will not be precompiled. This is useful when | |
1298 # using distcc to distribute a build to compile slaves that don't | |
1299 # share the same compiler executable as the system driving the compilation, | |
1300 # because precompiled headers rely on pointers into a specific compiler | |
1301 # executable's image. Setting this to 0 is needed to use an experimental | |
1302 # Linux-Mac cross compiler distcc farm. | |
1303 'chromium_mac_pch%': 1, | |
1304 | |
1305 # The default value for mac_strip in target_defaults. This cannot be | |
1306 # set there, per the comment about variable% in a target_defaults. | |
1307 'mac_strip_release%': 0, | |
1308 | |
1309 # Set to 1 to enable java code coverage. Instruments classes during build | |
1310 # to produce .ec files during runtime. | |
1311 'emma_coverage%': 0, | |
1312 | |
1313 # EMMA filter string consisting of a list of inclusion/exclusion patterns | |
1314 # separated with whitespace and/or comma. Only has effect if | |
1315 # 'emma_coverage=1'. | |
1316 'emma_filter%': '', | |
1317 | |
1318 # Set to 1 to enable running Android lint on java/class files. | |
1319 'android_lint%': 1, | |
1320 | |
1321 # Although base/allocator lets you select a heap library via an | |
1322 # environment variable, the shim it uses sometimes gets in the way. | |
1323 # To disable it entirely, and switch to normal msvcrt, do e.g. | |
1324 # 'win_use_allocator_shim': 0, | |
1325 # 'win_release_RuntimeLibrary': 2 | |
1326 # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build. | |
1327 'win_use_allocator_shim%': 1, # 1 = shim allocator; 0 = msvcrt | |
1328 | |
1329 # Enables the unified allocator shim (experimental) which routes all the | |
1330 # alloc calls to base/. Right now is supported on Linux Desktop only. | |
1331 # http://crbug.com/550886 . | |
1332 'use_experimental_allocator_shim%': 0, | |
1333 | |
1334 # TODO(bradnelson): eliminate this when possible. | |
1335 # To allow local gyp files to prevent release.vsprops from being included. | |
1336 # Yes(1) means include release.vsprops. | |
1337 # Once all vsprops settings are migrated into gyp, this can go away. | |
1338 'msvs_use_common_release%': 1, | |
1339 | |
1340 # TODO(bradnelson): eliminate this when possible. | |
1341 # To allow local gyp files to override additional linker options for msvs. | |
1342 # Yes(1) means set use the common linker options. | |
1343 'msvs_use_common_linker_extras%': 1, | |
1344 | |
1345 # TODO(sgk): eliminate this if possible. | |
1346 # It would be nicer to support this via a setting in 'target_defaults' | |
1347 # in chrome/app/locales/locales.gypi overriding the setting in the | |
1348 # 'Debug' configuration in the 'target_defaults' dict below, | |
1349 # but that doesn't work as we'd like. | |
1350 'msvs_debug_link_incremental%': '2', | |
1351 | |
1352 # Needed for some of the largest modules. | |
1353 'msvs_debug_link_nonincremental%': '1', | |
1354 | |
1355 # Turns on Use Library Dependency Inputs for linking chrome.dll on Windows | |
1356 # to get incremental linking to be faster in debug builds. | |
1357 'incremental_chrome_dll%': '0', | |
1358 | |
1359 # Experimental setting to break chrome.dll into multiple pieces based on | |
1360 # process type. | |
1361 'chrome_multiple_dll%': '0', | |
1362 | |
1363 # Whether the VS xtree header has been patched to disable warning 4702. If | |
1364 # it has, then we don't need to disable 4702 (unreachable code warning). | |
1365 # The patch is preapplied to the internal toolchain and hence all bots. | |
1366 'msvs_xtree_patched%': '<!pymod_do_main(win_is_xtree_patched)', | |
1367 | |
1368 # Clang stuff. | |
1369 'clang%': '<(clang)', | |
1370 'host_clang%': '<(host_clang)', | |
1371 'make_clang_dir%': '<(make_clang_dir)', | |
1372 'use_lld%': '<(use_lld)', | |
1373 | |
1374 # Control which version of clang to use when building for iOS. If set to | |
1375 # '1', uses the version of clang that ships with Xcode. If set to '0', uses | |
1376 # the version of clang that ships with the Chromium source. This variable | |
1377 # is automatically set to '1' in Official builds. | |
1378 'clang_xcode%': 0, | |
1379 | |
1380 # These two variables can be set in GYP_DEFINES while running | |
1381 # |gclient runhooks| to let clang run a plugin in every compilation. | |
1382 # Only has an effect if 'clang=1' is in GYP_DEFINES as well. | |
1383 # Example: | |
1384 # GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dyl
ib clang_add_plugin=print-fns' gclient runhooks | |
1385 | |
1386 'clang_load%': '', | |
1387 'clang_add_plugin%': '', | |
1388 | |
1389 # Tell ld64 to write map files describing binary layout. Useful | |
1390 # for looking at what contributes to binary size, e.g. with | |
1391 # https://github.com/nico/bloat | |
1392 'mac_write_linker_maps%': 0, | |
1393 | |
1394 # The default type of gtest. | |
1395 'gtest_target_type%': 'executable', | |
1396 | |
1397 # Enable sampling based profiler. | |
1398 # See http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html | |
1399 'profiling%': '0', | |
1400 # Profile without optimizing out stack frames when profiling==1. | |
1401 'profiling_full_stack_frames%': '0', | |
1402 | |
1403 # And if we want to dump symbols for Breakpad-enabled builds. | |
1404 'linux_dump_symbols%': 0, | |
1405 # And if we want to strip the binary after dumping symbols. | |
1406 'linux_strip_binary%': 0, | |
1407 # If we want stack unwind support for backtrace(). | |
1408 'debug_unwind_tables%': 1, | |
1409 'release_unwind_tables%': 1, | |
1410 | |
1411 # Override where to find binutils | |
1412 'binutils_version%': 0, | |
1413 'binutils_dir%': '', | |
1414 | |
1415 # Enable TCMalloc. | |
1416 # Default of 'use_allocator' is set to 'none' if OS=='android' later. | |
1417 'use_allocator%': 'tcmalloc', | |
1418 | |
1419 # Set to 1 to link against gsettings APIs instead of using dlopen(). | |
1420 'linux_link_gsettings%': 0, | |
1421 | |
1422 # Enable use of OpenMAX DL FFT routines. | |
1423 'use_openmax_dl_fft%': '<(use_openmax_dl_fft)', | |
1424 | |
1425 # Enable new NPDevice API. | |
1426 'enable_new_npdevice_api%': 0, | |
1427 | |
1428 # .gyp files or targets should set chromium_code to 1 if they build | |
1429 # Chromium-specific code, as opposed to external code. This variable is | |
1430 # used to control such things as the set of warnings to enable, and | |
1431 # whether warnings are treated as errors. | |
1432 'chromium_code%': 0, | |
1433 | |
1434 # Disable fatal linker warnings, similarly to how we make it possible | |
1435 # to disable -Werror (e.g. for different toolchain versions). | |
1436 'disable_fatal_linker_warnings%': 0, | |
1437 | |
1438 'release_valgrind_build%': 0, | |
1439 | |
1440 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600 | |
1441 'enable_wexit_time_destructors%': 0, | |
1442 | |
1443 # Set to 1 to compile with the OpenGL ES 2.0 conformance tests. | |
1444 'internal_gles2_conform_tests%': 0, | |
1445 | |
1446 # Set to 1 to compile with the Khronos GL-CTS conformance tests. | |
1447 'internal_khronos_glcts_tests%': 0, | |
1448 | |
1449 # Set to 1 to compile the filter fuzzer. | |
1450 'internal_filter_fuzzer%': 0, | |
1451 | |
1452 # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_' | |
1453 # so Cocoa is happy (http://crbug.com/20441). | |
1454 'locales': [ | |
1455 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', | |
1456 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he', | |
1457 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv', | |
1458 'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru', | |
1459 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk', | |
1460 'vi', 'zh-CN', 'zh-TW', | |
1461 ], | |
1462 | |
1463 # Pseudo locales are special locales which are used for testing and | |
1464 # debugging. They don't get copied to the final app. For more info, | |
1465 # check out https://www.chromium.org/developers/testing/fake-bidi | |
1466 'pseudo_locales': [ | |
1467 'fake-bidi', | |
1468 ], | |
1469 | |
1470 'grit_defines': [], | |
1471 | |
1472 # If debug_devtools is set to 1, JavaScript files for DevTools are | |
1473 # stored as is and loaded from disk. Otherwise, a concatenated file | |
1474 # is stored in resources.pak. It is still possible to load JS files | |
1475 # from disk by passing --debug-devtools cmdline switch. | |
1476 'debug_devtools%': 0, | |
1477 | |
1478 # The Java Bridge is not compiled in by default. | |
1479 'java_bridge%': 0, | |
1480 | |
1481 # Code signing for iOS binaries. The bots need to be able to disable this. | |
1482 'chromium_ios_signing%': 1, | |
1483 | |
1484 # Identity to use for code signing of iOS binaries. Change this on machines | |
1485 # with multiple identities in their security keychain. | |
1486 'chromium_ios_signing_identity%': 'iPhone Developer', | |
1487 | |
1488 # This flag is only used when disable_nacl==0 and disables all those | |
1489 # subcomponents which would require the installation of a native_client | |
1490 # untrusted toolchain. | |
1491 'disable_nacl_untrusted%': 0, | |
1492 | |
1493 # PNaCl toolchain does not support sanitizers. Disable by default. | |
1494 'enable_nacl_nonsfi_test%': 0, | |
1495 | |
1496 # Disable Dart by default. | |
1497 'enable_dart%': 0, | |
1498 | |
1499 # Copy out the setting of disable_nacl. | |
1500 'disable_nacl%': '<(disable_nacl)', | |
1501 | |
1502 # Native Client toolchains, enabled by default. | |
1503 'disable_pnacl%': '<(disable_pnacl)', | |
1504 'disable_newlib%': '<(disable_newlib)', | |
1505 | |
1506 # Whether to build full debug version for Debug configuration on Android. | |
1507 # Compared to full debug version, the default Debug configuration on Android | |
1508 # has no full v8 debug, has size optimization and linker gc section, so that | |
1509 # we can build a debug version with acceptable size and performance. | |
1510 'android_full_debug%': 0, | |
1511 | |
1512 # Contains data about the attached devices for gyp_managed_install. | |
1513 'build_device_config_path': '<(PRODUCT_DIR)/build_devices.cfg', | |
1514 | |
1515 'wix_exists': '<!pymod_do_main(dir_exists "<(wix_path)")', | |
1516 | |
1517 'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/10', | |
1518 'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files', | |
1519 | |
1520 # Whether we are using the rlz library or not. Platforms like Android send | |
1521 # rlz codes for searches but do not use the library. | |
1522 'enable_rlz_support%': 0, | |
1523 'enable_rlz%': 0, | |
1524 | |
1525 # Turns on the i18n support in V8. | |
1526 'v8_enable_i18n_support': 1, | |
1527 | |
1528 # Compile the v8 shell for the host toolset. | |
1529 'v8_toolset_for_shell': 'host', | |
1530 | |
1531 # V8 extras | |
1532 # Adding V8 extras files requires API owners review | |
1533 # Be sure to synchronize with build/module_args/v8.gni | |
1534 | |
1535 'v8_extra_library_files': [ | |
1536 '../third_party/WebKit/Source/core/streams/ByteLengthQueuingStrategy.js', | |
1537 '../third_party/WebKit/Source/core/streams/CountQueuingStrategy.js', | |
1538 '../third_party/WebKit/Source/core/streams/ReadableStream.js', | |
1539 ], | |
1540 'v8_experimental_extra_library_files': [ | |
1541 ], | |
1542 | |
1543 # Use brlapi from brltty for braille display support. | |
1544 'use_brlapi%': 0, | |
1545 | |
1546 # Relative path to icu.gyp from this file. | |
1547 'icu_gyp_path': '../third_party/icu/icu.gyp', | |
1548 | |
1549 # IPC fuzzer is disabled by default. | |
1550 'enable_ipc_fuzzer%': 0, | |
1551 | |
1552 # Force disable libstdc++ debug mode. | |
1553 'disable_glibcxx_debug%': 0, | |
1554 | |
1555 # Support ChromeOS touchpad gestures with ozone. | |
1556 'use_evdev_gestures%': 0, | |
1557 | |
1558 # Default ozone platform (if no --ozone-platform flag). | |
1559 'ozone_platform%': "", | |
1560 | |
1561 # Ozone platforms to include in the build. | |
1562 'ozone_platform_caca%': 0, | |
1563 'ozone_platform_cast%': 0, | |
1564 'ozone_platform_gbm%': 0, | |
1565 'ozone_platform_headless%': 0, | |
1566 'ozone_platform_wayland%': 0, | |
1567 | |
1568 # Experiment: http://crbug.com/426914 | |
1569 'envoy%': 0, | |
1570 | |
1571 # Used to set libjpeg_gyp_path. Chrome OS ui/gfx/gfx.gyp uses the IJG path | |
1572 # for robust login screen decoding. | |
1573 'libjpeg_ijg_gyp_path': '<(DEPTH)/third_party/libjpeg/libjpeg.gyp', | |
1574 'libjpeg_turbo_gyp_path': '<(DEPTH)/third_party/libjpeg_turbo/libjpeg.gyp', | |
1575 | |
1576 'conditions': [ | |
1577 # Enable the Syzygy optimization step for the official builds. | |
1578 ['OS=="win" and buildtype=="Official" and syzyasan!=1 and clang!=1', { | |
1579 'syzygy_optimize%': 1, | |
1580 }, { | |
1581 'syzygy_optimize%': 0, | |
1582 }], | |
1583 ['sanitizer_coverage==1', { | |
1584 'sanitizer_coverage': 'edge,indirect-calls,8bit-counters', | |
1585 }], | |
1586 # Get binutils version so we can enable debug fission if we can. | |
1587 ['os_posix==1 and OS!="mac" and OS!="ios"', { | |
1588 'conditions': [ | |
1589 # compiler_version doesn't work with clang | |
1590 # TODO(mithro): Land https://codereview.chromium.org/199793014/ so | |
1591 # compiler_version works with clang. | |
1592 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so | |
1593 # that it takes effect here. | |
1594 ['clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==
0 and ubsan_security==0 and ubsan_vptr==0', { | |
1595 'binutils_version%': '<!pymod_do_main(compiler_version target assemb
ler)', | |
1596 }], | |
1597 # On Android we know the binutils version in the toolchain. | |
1598 ['OS=="android"', { | |
1599 'binutils_version%': 222, | |
1600 }], | |
1601 ['host_arch=="x64"', { | |
1602 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin', | |
1603 }], | |
1604 ['host_arch=="ia32"', { | |
1605 'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin', | |
1606 }], | |
1607 # Our version of binutils in third_party/binutils | |
1608 ['linux_use_bundled_binutils==1', { | |
1609 'binutils_version%': 224, | |
1610 }], | |
1611 ], | |
1612 }, { | |
1613 'binutils_version%': 0, | |
1614 }], | |
1615 ['OS=="win" and "<!pymod_do_main(dir_exists <(directx_sdk_default_path))"=
="True"', { | |
1616 'directx_sdk_path%': '<(directx_sdk_default_path)', | |
1617 }, { | |
1618 'directx_sdk_path%': '$(DXSDK_DIR)', | |
1619 }], | |
1620 ['OS=="win"', { | |
1621 'windows_driver_kit_path%': '$(WDK_DIR)', | |
1622 'conditions': [ | |
1623 ['component!="shared_library"', { | |
1624 'single_module_mode_handle_verifier%': 0, | |
1625 }, { | |
1626 'single_module_mode_handle_verifier%': 1, | |
1627 }], | |
1628 ], | |
1629 }], | |
1630 ['os_posix==1 and OS!="mac" and OS!="ios"', { | |
1631 'conditions': [ | |
1632 ['target_arch=="mipsel" or target_arch=="mips64el"', { | |
1633 'werror%': '', | |
1634 'disable_nacl%': 1, | |
1635 'nacl_untrusted_build%': 0, | |
1636 'use_allocator%': 'none', | |
1637 }], | |
1638 # Use a 64-bit linker to avoid running out of address space. The | |
1639 # buildbots should have a 64-bit kernel and a 64-bit libc installed. | |
1640 ['host_arch=="ia32" and target_arch=="ia32"', { | |
1641 # TODO(thestig) This is a horrible way to force the desired | |
1642 # configuration. Our gyp variable scoping is likely wrong and | |
1643 # needs to be cleaned up. The GN configuration should be changed | |
1644 # to match. | |
1645 'binutils_version%': 224, | |
1646 'linux_use_bundled_binutils%': '1', | |
1647 'linux_use_bundled_gold%': '1', | |
1648 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin', | |
1649 }], | |
1650 # All Chrome builds have breakpad symbols, but only process the | |
1651 # symbols from official builds. | |
1652 ['(branding=="Chrome" and buildtype=="Official")', { | |
1653 'linux_dump_symbols%': 1, | |
1654 | |
1655 # Omit unwind support in official release builds to save space. We | |
1656 # can use breakpad for these builds. | |
1657 'release_unwind_tables%': 0, | |
1658 }], | |
1659 ], | |
1660 }], # os_posix==1 and OS!="mac" and OS!="ios" | |
1661 ['OS=="ios"', { | |
1662 'disable_nacl%': 1, | |
1663 'icu_use_data_file_flag%': 1, | |
1664 'enable_web_speech%': 0, | |
1665 'use_system_libxml%': 1, | |
1666 'use_system_sqlite%': 1, | |
1667 'locales==': [ | |
1668 'ar', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', 'en-US', 'es', 'es-MX', | |
1669 'fi', 'fr', 'he', 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'ms', | |
1670 'nb', 'nl', 'pl', 'pt', 'pt-PT', 'ro', 'ru', 'sk', 'sv', 'th', 'tr', | |
1671 'uk', 'vi', 'zh-CN', 'zh-TW', | |
1672 ], | |
1673 | |
1674 # iOS SDK and deployment target support. The |ios_sdk| value is left | |
1675 # blank so that when it is set in the project files it will be the | |
1676 # "current" iOS SDK. Forcing a specific SDK even if it is "current" | |
1677 # causes Xcode to spit out a warning for every single project file for | |
1678 # not using the "current" SDK. | |
1679 'ios_sdk%': '', | |
1680 'ios_sdk_path%': '', | |
1681 'ios_deployment_target%': '9.0', | |
1682 | |
1683 'conditions': [ | |
1684 # ios_product_name is set to the name of the .app bundle as it should | |
1685 # appear on disk. | |
1686 ['branding=="Chrome"', { | |
1687 'ios_product_name%': 'Chrome', | |
1688 }, { # else: branding!="Chrome" | |
1689 'ios_product_name%': 'Chromium', | |
1690 }], | |
1691 ['branding=="Chrome" and buildtype=="Official"', { | |
1692 'ios_breakpad%': 1, | |
1693 }, { # else: branding!="Chrome" or buildtype!="Official" | |
1694 'ios_breakpad%': 0, | |
1695 }], | |
1696 ], | |
1697 }], # OS=="ios" | |
1698 ['OS=="android"', { | |
1699 # Location of Android NDK. | |
1700 'variables': { | |
1701 'variables': { | |
1702 # Standard libraries can use the relative path to the NDK. | |
1703 'android_ndk_root%': '../../third_party/android_tools/ndk/', | |
1704 # Unfortunately, it is required to use the absolute path to the SDK | |
1705 # because it us passed to ant which uses a different relative path | |
1706 # from GYP. | |
1707 'android_sdk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_
tools/sdk/', | |
1708 # Similarly, gdbserver and the Android toolchain need to use the | |
1709 # absolute path to the NDK because they are used at different levels | |
1710 # in the GYP files. | |
1711 'android_ndk_absolute_root%': '<!(cd <(DEPTH) && pwd -P)/third_party
/android_tools/ndk/', | |
1712 'android_host_arch%': '<!(uname -m)', | |
1713 # Version of the NDK. Used to ensure full rebuilds on NDK rolls. | |
1714 'android_ndk_version%': 'r10e', | |
1715 # Android API-level of the SDK used for compilation. | |
1716 'android_sdk_version%': '23', | |
1717 'android_sdk_build_tools_version%': '23.0.1', | |
1718 'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')", | |
1719 | |
1720 'conditions': [ | |
1721 # Figure this out early since it needs symbols from libgcc.a, so i
t | |
1722 # has to be before that in the set of libraries. | |
1723 # ASan needs to dynamically link to libc++ even in static builds s
o | |
1724 # that it can interpose operator new. | |
1725 ['component=="shared_library" or asan==1', { | |
1726 'android_libcpp_library': 'c++_shared', | |
1727 'android_must_copy_system_libraries': 1, | |
1728 }, { | |
1729 'android_libcpp_library': 'c++_static', | |
1730 'android_must_copy_system_libraries': 0, | |
1731 }], | |
1732 ], | |
1733 | |
1734 }, | |
1735 # Copy conditionally-set variables out one scope. | |
1736 'android_ndk_root%': '<(android_ndk_root)', | |
1737 'android_ndk_absolute_root%': '<(android_ndk_absolute_root)', | |
1738 'android_ndk_version%': '<(android_ndk_version)', | |
1739 'android_sdk_root%': '<(android_sdk_root)', | |
1740 'android_sdk_version%': '<(android_sdk_version)', | |
1741 'android_sdk_build_tools_version%': '<(android_sdk_build_tools_version
)', | |
1742 'android_libcpp_root': '<(android_ndk_root)/sources/cxx-stl/llvm-libc+
+', | |
1743 'android_libcpp_library': '<(android_libcpp_library)', | |
1744 'android_must_copy_system_libraries': '<(android_must_copy_system_libr
aries)', | |
1745 'host_os%': '<(host_os)', | |
1746 | |
1747 'android_sdk%': '<(android_sdk_root)/platforms/android-<(android_sdk_v
ersion)', | |
1748 # Android SDK build tools (e.g. dx, aidl) | |
1749 'android_sdk_tools%': '<(android_sdk_root)/build-tools/<(android_sdk_b
uild_tools_version)', | |
1750 | |
1751 # Android API level 16 is JB (Android 4.1) which is the minimum | |
1752 # platform requirement for Chrome on Android, we use it for native | |
1753 # code compilation. | |
1754 'conditions': [ | |
1755 ['target_arch == "ia32"', { | |
1756 'android_app_abi%': 'x86', | |
1757 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/andro
id-x86/gdbserver/gdbserver', | |
1758 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-16/
arch-x86', | |
1759 'android_ndk_lib_dir%': 'usr/lib', | |
1760 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/x86
-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin', | |
1761 }], | |
1762 ['target_arch == "x64"', { | |
1763 'android_app_abi%': 'x86_64', | |
1764 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/andro
id-x86_64/gdbserver/gdbserver', | |
1765 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/
arch-x86_64', | |
1766 'android_ndk_lib_dir%': 'usr/lib64', | |
1767 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/x86
_64-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin', | |
1768 }], | |
1769 ['target_arch=="arm"', { | |
1770 'conditions': [ | |
1771 ['arm_version<7', { | |
1772 'android_app_abi%': 'armeabi', | |
1773 }, { | |
1774 'android_app_abi%': 'armeabi-v7a', | |
1775 }], | |
1776 ], | |
1777 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/andro
id-arm/gdbserver/gdbserver', | |
1778 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-16/
arch-arm', | |
1779 'android_ndk_lib_dir%': 'usr/lib', | |
1780 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/arm
-linux-androideabi-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin', | |
1781 }], | |
1782 ['target_arch == "arm64"', { | |
1783 'android_app_abi%': 'arm64-v8a', | |
1784 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/andro
id-arm64/gdbserver/gdbserver', | |
1785 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/
arch-arm64', | |
1786 'android_ndk_lib_dir%': 'usr/lib', | |
1787 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/aar
ch64-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin', | |
1788 }], | |
1789 ['target_arch == "mipsel"', { | |
1790 'android_app_abi%': 'mips', | |
1791 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/andro
id-mips/gdbserver/gdbserver', | |
1792 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-16/
arch-mips', | |
1793 'android_ndk_lib_dir%': 'usr/lib', | |
1794 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/mip
sel-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin', | |
1795 }], | |
1796 ['target_arch == "mips64el"', { | |
1797 'android_app_abi%': 'mips64', | |
1798 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/andro
id-mips64/gdbserver/gdbserver', | |
1799 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/
arch-mips64', | |
1800 'android_ndk_lib_dir%': 'usr/lib64', | |
1801 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/mip
s64el-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin', | |
1802 }], | |
1803 ], | |
1804 }, | |
1805 # Copy conditionally-set variables out one scope. | |
1806 'android_app_abi%': '<(android_app_abi)', | |
1807 'android_gdbserver%': '<(android_gdbserver)', | |
1808 'android_ndk_root%': '<(android_ndk_root)', | |
1809 'android_ndk_sysroot%': '<(android_ndk_sysroot)', | |
1810 'android_ndk_version%': '<(android_ndk_version)', | |
1811 'android_sdk_root%': '<(android_sdk_root)', | |
1812 'android_sdk_version%': '<(android_sdk_version)', | |
1813 'android_toolchain%': '<(android_toolchain)', | |
1814 | |
1815 'android_ndk_include': '<(android_ndk_sysroot)/usr/include', | |
1816 'android_ndk_lib': '<(android_ndk_sysroot)/<(android_ndk_lib_dir)', | |
1817 'android_sdk_build_tools_version%': '<(android_sdk_build_tools_version)'
, | |
1818 'android_sdk_tools%': '<(android_sdk_tools)', | |
1819 'android_aapt_path%': '<(android_sdk_tools)/aapt', | |
1820 'android_sdk%': '<(android_sdk)', | |
1821 'android_sdk_jar%': '<(android_sdk)/android.jar', | |
1822 | |
1823 'android_libcpp_root': '<(android_libcpp_root)', | |
1824 'android_libcpp_library': '<(android_libcpp_library)', | |
1825 'android_libcpp_include': '<(android_libcpp_root)/libcxx/include', | |
1826 'android_libcpp_libs_dir%': '<(android_libcpp_root)/libs/<(android_app_a
bi)', | |
1827 'android_must_copy_system_libraries': '<(android_must_copy_system_librar
ies)', | |
1828 'host_os%': '<(host_os)', | |
1829 | |
1830 # Location of the "objcopy" binary, used by both gyp and scripts. | |
1831 'android_objcopy%' : '<!(/bin/echo -n <(android_toolchain)/*-objcopy)', | |
1832 | |
1833 # Location of the "strip" binary, used by both gyp and scripts. | |
1834 'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)', | |
1835 | |
1836 # Location of the "readelf" binary. | |
1837 'android_readelf%' : '<!(/bin/echo -n <(android_toolchain)/*-readelf)', | |
1838 | |
1839 # Determines whether we should optimize JNI generation at the cost of | |
1840 # breaking assumptions in the build system that when inputs have changed | |
1841 # the outputs should always change as well. This is meant purely for | |
1842 # developer builds, to avoid spurious re-linking of native files. | |
1843 'optimize_jni_generation%': '<(optimize_jni_generation)', | |
1844 | |
1845 # Use OpenSSL's struct X509 to represent certificates. | |
1846 'use_openssl_certs%': 1, | |
1847 | |
1848 'proprietary_codecs%': '<(proprietary_codecs)', | |
1849 | |
1850 'safe_browsing%': 2, | |
1851 | |
1852 'enable_web_speech%': 0, | |
1853 'java_bridge%': 1, | |
1854 'use_allocator%': 'none', | |
1855 | |
1856 # Disable Native Client. | |
1857 'disable_nacl%': 1, | |
1858 | |
1859 # Sessions are store separately in the Java side. | |
1860 'enable_session_service%': 0, | |
1861 | |
1862 'p2p_apis%' : 0, | |
1863 | |
1864 'gtest_target_type%': 'shared_library', | |
1865 }], # OS=="android" | |
1866 ['embedded==1', { | |
1867 'use_system_fontconfig%': 0, | |
1868 }, { | |
1869 'use_system_fontconfig%': 1, | |
1870 }], | |
1871 ['chromecast==1', { | |
1872 'conditions': [ | |
1873 ['target_arch=="arm"', { | |
1874 'arm_arch%': '', | |
1875 'arm_tune%': 'cortex-a9', | |
1876 'arm_thumb%': 1, | |
1877 }], | |
1878 # TODO(dalecurtis): What audio codecs does Chromecast want here? Sort | |
1879 # out and add configs if necessary. http://crbug.com/570754 | |
1880 ['OS!="android"', { | |
1881 'ffmpeg_branding%': 'ChromeOS', | |
1882 }], | |
1883 ], | |
1884 }], | |
1885 ['OS=="linux"', { | |
1886 'clang%': 1, | |
1887 'conditions': [ | |
1888 ['target_arch=="arm64"', { | |
1889 # Temporarily disable nacl and tcmalloc on arm64 linux to get | |
1890 # rid of compilation errors. | |
1891 'disable_nacl%': 1, | |
1892 'use_allocator%': 'none', | |
1893 }], | |
1894 ], | |
1895 }], # OS=="mac" | |
1896 ['OS=="mac"', { | |
1897 'conditions': [ | |
1898 # All Chrome builds have breakpad symbols, but only process the | |
1899 # symbols from official builds. | |
1900 ['(branding=="Chrome" and buildtype=="Official")', { | |
1901 'mac_strip_release%': 1, | |
1902 }], | |
1903 ], | |
1904 }], # OS=="mac" | |
1905 ['OS=="mac" or OS=="ios"', { | |
1906 'clang%': 1, | |
1907 | |
1908 # On Mac and iOS we just use the default system allocator. | |
1909 'use_allocator%': 'none', | |
1910 | |
1911 'variables': { | |
1912 # Mac OS X SDK and deployment target support. The SDK identifies | |
1913 # the version of the system headers that will be used, and | |
1914 # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time | |
1915 # macro. "Maximum allowed" refers to the operating system version | |
1916 # whose APIs are available in the headers. The deployment target | |
1917 # identifies the minimum system version that the built products are | |
1918 # expected to function on. It corresponds to the | |
1919 # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. To ensure these | |
1920 # macros are available, #include <AvailabilityMacros.h>. Additional | |
1921 # documentation on these macros is available at | |
1922 # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#
SECTION3 | |
1923 # Chrome normally builds with the Mac OS X 10.10 SDK and sets the | |
1924 # deployment target to 10.7. Other projects, such as O3D, may | |
1925 # override these defaults. | |
1926 | |
1927 # Normally, mac_sdk_min is used to find an SDK that Xcode knows | |
1928 # about that is at least the specified version. In official builds, | |
1929 # the SDK must match mac_sdk_min exactly. If the SDK is installed | |
1930 # someplace that Xcode doesn't know about, set mac_sdk_path to the | |
1931 # path to the SDK; when set to a non-empty string, SDK detection | |
1932 # based on mac_sdk_min will be bypassed entirely. | |
1933 'mac_deployment_target%': '10.7', | |
1934 'mac_sdk_min%': '10.10', | |
1935 'mac_sdk_path%': '', | |
1936 }, | |
1937 | |
1938 'mac_sdk_min': '<(mac_sdk_min)', | |
1939 'mac_sdk_path': '<(mac_sdk_path)', | |
1940 'mac_deployment_target': '<(mac_deployment_target)', | |
1941 | |
1942 # Compile in Breakpad support by default so that it can be | |
1943 # tested, even if it is not enabled by default at runtime. | |
1944 'mac_breakpad_compiled_in%': 1, | |
1945 'conditions': [ | |
1946 # mac_product_name is set to the name of the .app bundle as it should | |
1947 # appear on disk. This duplicates data from | |
1948 # chrome/app/theme/chromium/BRANDING and | |
1949 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get | |
1950 # these names into the build system. | |
1951 ['branding=="Chrome"', { | |
1952 'mac_product_name%': 'Google Chrome', | |
1953 }, { # else: branding!="Chrome" | |
1954 'mac_product_name%': 'Chromium', | |
1955 }], | |
1956 # Official mac builds require a specific OS X SDK, but iOS and | |
1957 # non-official mac builds do not. | |
1958 ['branding=="Chrome" and buildtype=="Official" and OS=="mac"', { | |
1959 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py --verify <(mac
_sdk_min) --sdk_path=<(mac_sdk_path))', | |
1960 }, { | |
1961 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min)
)', | |
1962 }], | |
1963 ['branding=="Chrome" and buildtype=="Official"', { | |
1964 # Enable uploading crash dumps. | |
1965 'mac_breakpad_uploads%': 1, | |
1966 # Enable dumping symbols at build time for use by Mac Breakpad. | |
1967 'mac_breakpad%': 1, | |
1968 # Enable Keystone auto-update support. | |
1969 'mac_keystone%': 1, | |
1970 }, { # else: branding!="Chrome" or buildtype!="Official" | |
1971 'mac_breakpad_uploads%': 0, | |
1972 'mac_breakpad%': 0, | |
1973 'mac_keystone%': 0, | |
1974 }], | |
1975 ], | |
1976 }], # OS=="mac" or OS=="ios" | |
1977 ['OS=="win"', { | |
1978 'conditions': [ | |
1979 # This is the architecture convention used in WinSDK paths. | |
1980 ['target_arch=="ia32"', { | |
1981 'winsdk_arch%': 'x86', | |
1982 },{ | |
1983 'winsdk_arch%': '<(target_arch)', | |
1984 }], | |
1985 ['component=="shared_library"', { | |
1986 'win_use_allocator_shim%': 0, | |
1987 }], | |
1988 ['component=="static_library"', { | |
1989 # Turn on multiple dll by default on Windows when in static_library. | |
1990 'chrome_multiple_dll%': 1, | |
1991 }], | |
1992 ['asan==1 or syzyasan==1', { | |
1993 'win_use_allocator_shim%': 0, | |
1994 }], | |
1995 # The AddressSanitizer build should be a console program as it prints | |
1996 # out stuff on stderr. | |
1997 ['asan==1', { | |
1998 'win_console_app%': 1, | |
1999 }, { | |
2000 'win_console_app%': 0, | |
2001 }], | |
2002 # Enable the Kasko reporter for syzyasan builds. | |
2003 ['syzyasan==1', { | |
2004 'kasko': 1, | |
2005 }], | |
2006 ['component=="shared_library"', { | |
2007 # Not enabled for component=static_library because some targets | |
2008 # are too large and the toolchain fails due to the size of the | |
2009 # .obj files. | |
2010 'incremental_chrome_dll%': 1, | |
2011 }], | |
2012 # Don't do incremental linking for large modules on 32-bit or when | |
2013 # component=static_library as the toolchain fails due to the size of | |
2014 # the .ilk files. | |
2015 ['MSVS_OS_BITS==32 or component=="static_library"', { | |
2016 'msvs_large_module_debug_link_mode%': '1', # No | |
2017 },{ | |
2018 'msvs_large_module_debug_link_mode%': '2', # Yes | |
2019 }], | |
2020 ['chrome_pgo_phase!=0', { | |
2021 'full_wpo_on_official%': 1, | |
2022 }], | |
2023 ], | |
2024 'nacl_win64_defines': [ | |
2025 # This flag is used to minimize dependencies when building | |
2026 # Native Client loader for 64-bit Windows. | |
2027 'NACL_WIN64', | |
2028 ], | |
2029 # Need to include allocator target, but exclude tcmalloc files. | |
2030 'use_allocator%': 'winheap', | |
2031 }], | |
2032 | |
2033 ['os_posix==1 and chromeos==0 and OS!="android" and OS!="ios" and embedded
==0', { | |
2034 'use_cups%': 1, | |
2035 }, { | |
2036 'use_cups%': 0, | |
2037 }], | |
2038 | |
2039 ['enable_plugins==1 and (OS=="linux" or OS=="mac" or OS=="win") and chrome
cast==0', { | |
2040 'enable_pepper_cdms%': 1, | |
2041 }, { | |
2042 'enable_pepper_cdms%': 0, | |
2043 }], | |
2044 | |
2045 ['OS=="android" or chromecast==1', { | |
2046 'enable_browser_cdms%': 1, | |
2047 }, { | |
2048 'enable_browser_cdms%': 0, | |
2049 }], | |
2050 | |
2051 # Native Client glibc toolchain is enabled except on mips | |
2052 ['target_arch=="mipsel" or target_arch=="mips64el"', { | |
2053 'disable_glibc%': 1, | |
2054 }, { | |
2055 'disable_glibc%': 0, | |
2056 }], | |
2057 | |
2058 # Set the relative path from this file to the GYP file of the JPEG | |
2059 # library used by Chromium. | |
2060 ['use_system_libjpeg==1 or use_libjpeg_turbo==0', { | |
2061 # Configuration for using the system libjeg is here. | |
2062 'libjpeg_gyp_path': '<(libjpeg_ijg_gyp_path)', | |
2063 }, { | |
2064 'libjpeg_gyp_path': '<(libjpeg_turbo_gyp_path)', | |
2065 }], | |
2066 | |
2067 # Options controlling the use of GConf (the classic GNOME configuration | |
2068 # system) and GIO, which contains GSettings (the new GNOME config system). | |
2069 ['chromeos==1 or embedded==1', { | |
2070 'use_gconf%': 0, | |
2071 'use_gio%': 0, | |
2072 }, { | |
2073 'use_gconf%': 1, | |
2074 'use_gio%': 1, | |
2075 }], | |
2076 | |
2077 # Set up -D and -E flags passed into grit. | |
2078 ['branding=="Chrome"', { | |
2079 # TODO(mmoss) The .grd files look for _google_chrome, but for | |
2080 # consistency they should look for google_chrome_build like C++. | |
2081 'grit_defines': ['-D', '_google_chrome', | |
2082 '-E', 'CHROMIUM_BUILD=google_chrome'], | |
2083 }, { | |
2084 'grit_defines': ['-D', '_chromium', | |
2085 '-E', 'CHROMIUM_BUILD=chromium'], | |
2086 }], | |
2087 ['chromeos==1', { | |
2088 'grit_defines': ['-D', 'chromeos', '-D', 'scale_factors=2x'], | |
2089 }], | |
2090 ['desktop_linux==1', { | |
2091 'grit_defines': ['-D', 'desktop_linux'], | |
2092 }], | |
2093 ['toolkit_views==1', { | |
2094 'grit_defines': ['-D', 'toolkit_views'], | |
2095 }], | |
2096 ['use_aura==1', { | |
2097 'grit_defines': ['-D', 'use_aura'], | |
2098 }], | |
2099 ['use_ash==1', { | |
2100 'grit_defines': ['-D', 'use_ash'], | |
2101 }], | |
2102 ['use_nss_certs==1', { | |
2103 'grit_defines': ['-D', 'use_nss_certs'], | |
2104 }], | |
2105 ['use_ozone==1', { | |
2106 'grit_defines': ['-D', 'use_ozone'], | |
2107 }], | |
2108 ['image_loader_extension==1', { | |
2109 'grit_defines': ['-D', 'image_loader_extension'], | |
2110 }], | |
2111 ['use_titlecase_in_grd==1', { | |
2112 'grit_defines': ['-D', 'use_titlecase'], | |
2113 }], | |
2114 ['OS=="android"', { | |
2115 'grit_defines': [ | |
2116 '-t', 'android', | |
2117 '-E', 'ANDROID_JAVA_TAGGED_ONLY=true', | |
2118 '--no-output-all-resource-defines', | |
2119 ], | |
2120 }], | |
2121 ['OS=="mac" or OS=="ios"', { | |
2122 'grit_defines': ['-D', 'scale_factors=2x'], | |
2123 }], | |
2124 ['OS == "ios"', { | |
2125 'variables': { | |
2126 'enable_coverage%': 0, | |
2127 }, | |
2128 'grit_defines': [ | |
2129 '-t', 'ios', | |
2130 '--no-output-all-resource-defines', | |
2131 ], | |
2132 | |
2133 # Enable host builds. | |
2134 'host_os%': "mac", | |
2135 | |
2136 'conditions': [ | |
2137 # Use the version of clang shipped with Xcode when building official | |
2138 # version of Chrome for iOS. | |
2139 # | |
2140 # TODO(eugenebut): Remove enable_coverage check once | |
2141 # libclang_rt.profile_ios.a is bundled with Chromium's clang. | |
2142 # http://crbug.com/450379 | |
2143 ['buildtype=="Official" or enable_coverage', { | |
2144 'clang_xcode%': 1, | |
2145 }], | |
2146 ], | |
2147 }], | |
2148 ['enable_extensions==1', { | |
2149 'grit_defines': ['-D', 'enable_extensions'], | |
2150 }], | |
2151 ['enable_plugins!=0', { | |
2152 'grit_defines': ['-D', 'enable_plugins'], | |
2153 }], | |
2154 ['enable_basic_printing==1 or enable_print_preview==1', { | |
2155 'grit_defines': ['-D', 'enable_printing'], | |
2156 }], | |
2157 ['enable_print_preview==1', { | |
2158 'grit_defines': ['-D', 'enable_print_preview'], | |
2159 }], | |
2160 ['enable_themes==1', { | |
2161 'grit_defines': ['-D', 'enable_themes'], | |
2162 }], | |
2163 ['enable_app_list==1', { | |
2164 'grit_defines': ['-D', 'enable_app_list'], | |
2165 }], | |
2166 ['use_concatenated_impulse_responses==1', { | |
2167 'grit_defines': ['-D', 'use_concatenated_impulse_responses'], | |
2168 }], | |
2169 ['enable_media_router==1', { | |
2170 'grit_defines': ['-D', 'enable_media_router'], | |
2171 }], | |
2172 ['enable_webrtc==1', { | |
2173 'grit_defines': ['-D', 'enable_webrtc'], | |
2174 }], | |
2175 ['enable_hangout_services_extension==1', { | |
2176 'grit_defines': ['-D', 'enable_hangout_services_extension'], | |
2177 }], | |
2178 ['enable_task_manager==1', { | |
2179 'grit_defines': ['-D', 'enable_task_manager'], | |
2180 }], | |
2181 ['notifications==1', { | |
2182 'grit_defines': ['-D', 'enable_notifications'], | |
2183 }], | |
2184 ['mac_views_browser==1', { | |
2185 'grit_defines': ['-D', 'mac_views_browser'], | |
2186 }], | |
2187 ['enable_resource_whitelist_generation==1 and OS!="win"', { | |
2188 'grit_rc_header_format': ['-h', '#define {textual_id} _Pragma("whitelist
ed_resource_{numeric_id}") {numeric_id}'], | |
2189 }], | |
2190 ['enable_resource_whitelist_generation==1 and OS=="win"', { | |
2191 'grit_rc_header_format': ['-h', '#define {textual_id} __pragma(message("
whitelisted_resource_{numeric_id}")) {numeric_id}'], | |
2192 }], | |
2193 ['enable_mdns==1 or OS=="mac"', { | |
2194 'grit_defines': ['-D', 'enable_service_discovery'], | |
2195 'enable_service_discovery%': 1 | |
2196 }], | |
2197 ['clang_use_chrome_plugins==1', { | |
2198 'variables': { | |
2199 'conditions': [ | |
2200 ['OS!="win"', { | |
2201 'variables': { | |
2202 'conditions': [ | |
2203 ['OS=="mac" or OS=="ios"', { | |
2204 'clang_lib_path%': '<!(cd <(DEPTH) && pwd -P)/third_party/ll
vm-build/Release+Asserts/lib/libFindBadConstructs.dylib', | |
2205 }, { # OS != "mac" or OS != "ios" | |
2206 'clang_lib_path%': '<!(cd <(DEPTH) && pwd -P)/third_party/ll
vm-build/Release+Asserts/lib/libFindBadConstructs.so', | |
2207 }], | |
2208 ], | |
2209 }, | |
2210 'clang_dynlib_flags%': '-Xclang -load -Xclang <(clang_lib_path) ', | |
2211 }, { # OS == "win" | |
2212 # On Windows, the plugin is built directly into clang, so there's | |
2213 # no need to load it dynamically. | |
2214 'clang_dynlib_flags%': '', | |
2215 }], | |
2216 ['(OS=="android" or OS=="linux") and chromecast==0', { | |
2217 'clang_plugin_check_ipc_arg': '-Xclang -plugin-arg-find-bad-constr
ucts -Xclang check-ipc', | |
2218 }, { | |
2219 'clang_plugin_check_ipc_arg': '', | |
2220 }], | |
2221 ], | |
2222 'clang_plugin_args%': '-Xclang -plugin-arg-find-bad-constructs -Xclang
check-templates ' | |
2223 '-Xclang -plugin-arg-find-bad-constructs -Xclang follow-macro-expansio
n ', | |
2224 }, | |
2225 # If you change these, also change build/config/clang/BUILD.gn. | |
2226 'clang_chrome_plugins_flags%': | |
2227 '<(clang_dynlib_flags)' | |
2228 '-Xclang -add-plugin -Xclang find-bad-constructs <(clang_plugin_args)
<(clang_plugin_check_ipc_arg)', | |
2229 }], | |
2230 ['asan==1 or msan==1 or lsan==1 or tsan==1', { | |
2231 'clang%': 1, | |
2232 'use_allocator%': 'none', | |
2233 'use_sanitizer_options%': 1, | |
2234 }], | |
2235 ['(OS=="linux" or OS=="android") and asan==0 and msan==0 and lsan==0 and t
san==0 and build_for_tool==""', { | |
2236 'use_experimental_allocator_shim%': 1, | |
2237 }], | |
2238 ['OS=="linux" and asan==0 and msan==0 and lsan==0 and tsan==0', { | |
2239 # PNaCl toolchain Non-SFI build only supports linux OS build. | |
2240 # Also, it does not support sanitizers. | |
2241 'enable_nacl_nonsfi_test%': 1, | |
2242 }], | |
2243 ['asan==1 and OS=="linux" and chromeos==0', { | |
2244 'use_custom_libcxx%': 1, | |
2245 }], | |
2246 ['ubsan==1', { | |
2247 'clang%': 1, | |
2248 }], | |
2249 ['ubsan_security==1', { | |
2250 'clang%': 1, | |
2251 }], | |
2252 ['ubsan_vptr==1', { | |
2253 'clang%': 1, | |
2254 }], | |
2255 ['asan==1 and OS=="mac"', { | |
2256 'mac_strip_release': 1, | |
2257 }], | |
2258 ['tsan==1', { | |
2259 'use_custom_libcxx%': 1, | |
2260 }], | |
2261 ['msan==1', { | |
2262 # Use a just-built, MSan-instrumented libc++ instead of the system-wide | |
2263 # libstdc++. This is required to avoid false positive reports whenever | |
2264 # the C++ standard library is used. | |
2265 'use_custom_libcxx%': 1, | |
2266 # Running the V8-generated code on an ARM simulator is a powerful hack | |
2267 # that allows the tool to see the memory accesses from JITted code. | |
2268 # Without this flag, JS code causes false positive reports from MSan. | |
2269 'v8_target_arch': 'arm64', | |
2270 }], | |
2271 | |
2272 # Build tweaks for DrMemory. | |
2273 # TODO(rnk): Combine with tsan config to share the builder. | |
2274 # http://crbug.com/108155 | |
2275 ['build_for_tool=="drmemory"', { | |
2276 # These runtime checks force initialization of stack vars which blocks | |
2277 # DrMemory's uninit detection. | |
2278 'win_debug_RuntimeChecks': '0', | |
2279 # Iterator debugging is slow. | |
2280 'win_debug_disable_iterator_debugging': '1', | |
2281 # Try to disable optimizations that mess up stacks in a release build. | |
2282 # DrM-i#1054 (https://github.com/DynamoRIO/drmemory/issues/1054) | |
2283 # /O2 and /Ob0 (disable inline) cannot be used together because of a | |
2284 # compiler bug, so we use /Ob1 instead. | |
2285 'win_release_InlineFunctionExpansion': '1', | |
2286 'win_release_OmitFramePointers': '0', | |
2287 # Ditto for debug, to support bumping win_debug_Optimization. | |
2288 'win_debug_InlineFunctionExpansion': 0, | |
2289 'win_debug_OmitFramePointers': 0, | |
2290 # Keep the code under #ifndef NVALGRIND. | |
2291 'release_valgrind_build': 1, | |
2292 }], | |
2293 | |
2294 # RLZ library is used on Win, Mac, iOS and ChromeOS. | |
2295 ['OS=="win" or OS=="mac" or OS=="ios" or chromeos==1', { | |
2296 'enable_rlz_support%': 1, | |
2297 'conditions': [ | |
2298 # RLZ is enabled for "Chrome" builds. | |
2299 ['branding=="Chrome"', { | |
2300 'enable_rlz%': 1, | |
2301 }], | |
2302 ], | |
2303 }], | |
2304 | |
2305 # Set default compiler flags depending on ARM version. | |
2306 ['arm_version==6', { | |
2307 'arm_arch%': 'armv6', | |
2308 'arm_tune%': '', | |
2309 'arm_fpu%': 'vfp', | |
2310 'arm_float_abi%': 'softfp', | |
2311 'arm_thumb%': 0, | |
2312 }], | |
2313 ['arm_version==7', { | |
2314 'arm_arch%': 'armv7-a', | |
2315 'arm_tune%': 'generic-armv7-a', | |
2316 'conditions': [ | |
2317 ['arm_neon==1', { | |
2318 'arm_fpu%': 'neon', | |
2319 }, { | |
2320 'arm_fpu%': 'vfpv3-d16', | |
2321 }], | |
2322 ['OS=="android"', { | |
2323 'arm_float_abi%': 'softfp', | |
2324 }, { | |
2325 'arm_float_abi%': 'hard', | |
2326 }], | |
2327 ], | |
2328 'arm_thumb%': 1, | |
2329 }], | |
2330 | |
2331 # Set default compiler flags for MIPS floating-point support. | |
2332 ['target_arch=="mipsel"', { | |
2333 'mips_float_abi%': 'hard', | |
2334 }], | |
2335 ['target_arch=="mipsel" and mips_arch_variant=="r2"', { | |
2336 'mips_fpu_mode%': 'fp32', | |
2337 }, { | |
2338 'mips_fpu_mode%': '', | |
2339 }], | |
2340 | |
2341 # Enable brlapi by default for chromeos. | |
2342 ['chromeos==1', { | |
2343 'use_brlapi%': 1, | |
2344 }], | |
2345 | |
2346 ['use_ozone==1 and ozone_auto_platforms==1', { | |
2347 # Use headless as the default platform. | |
2348 'ozone_platform%': 'headless', | |
2349 'ozone_platform_headless%': 1, | |
2350 'conditions': [ | |
2351 ['chromecast==1', { | |
2352 'ozone_platform_cast%': 1, | |
2353 'conditions': [ | |
2354 # For desktop non-audio Chromecast builds, run with | |
2355 # --ozone-platform=x11 | |
2356 # TODO(slan|halliwell): Make the default platform "cast" on | |
2357 # desktop non-audio builds too. | |
2358 ['is_cast_desktop_build==1 and disable_display==0', { | |
2359 # Use GN instead. | |
2360 }, { | |
2361 'ozone_platform%': 'cast', | |
2362 }], | |
2363 ], | |
2364 }, { # chromecast!=1 | |
2365 # Build all platforms whose deps are in install-build-deps.sh. | |
2366 # Only these platforms will be compile tested by buildbots. | |
2367 'conditions': [ | |
2368 ['chromeos==1', { | |
2369 'ozone_platform_gbm%': 1, | |
2370 }], | |
2371 ], | |
2372 }], | |
2373 ], | |
2374 }], | |
2375 | |
2376 ['desktop_linux==1 and use_aura==1 and use_x11==1', { | |
2377 'use_clipboard_aurax11%': 1, | |
2378 }], | |
2379 | |
2380 ['OS=="win" and use_goma==1', { | |
2381 # goma doesn't support pch yet. | |
2382 'chromium_win_pch': 0, | |
2383 # goma doesn't support PDB yet, so win_z7=1 or fastbuild=1. | |
2384 'conditions': [ | |
2385 ['win_z7==0 and fastbuild==0', { | |
2386 'fastbuild': 1, | |
2387 }], | |
2388 ], | |
2389 }], | |
2390 | |
2391 ['host_clang==1', { | |
2392 'host_cc': '<(make_clang_dir)/bin/clang', | |
2393 'host_cxx': '<(make_clang_dir)/bin/clang++', | |
2394 }, { | |
2395 'host_cc': '<!(which gcc)', | |
2396 'host_cxx': '<!(which g++)', | |
2397 }], | |
2398 | |
2399 # The seccomp-bpf sandbox is only supported on five architectures | |
2400 # currently. | |
2401 # Do not disable seccomp_bpf anywhere without talking to | |
2402 # security@chromium.org! | |
2403 ['((OS=="linux" or OS=="android") and ' | |
2404 '(target_arch=="ia32" or target_arch=="x64" or ' | |
2405 'target_arch=="arm" or target_arch=="mipsel" or ' | |
2406 'target_arch=="arm64"))', { | |
2407 'use_seccomp_bpf%': 1, | |
2408 }, { | |
2409 'use_seccomp_bpf%': 0, | |
2410 }], | |
2411 | |
2412 ['cfi_vptr==1', { | |
2413 'use_lto%': 1, | |
2414 }], | |
2415 | |
2416 ['branding=="Chrome" and buildtype=="Official"', { | |
2417 'enable_hangout_services_extension%': 1, | |
2418 }, { | |
2419 'enable_hangout_services_extension%': 0, | |
2420 }], | |
2421 ], | |
2422 | |
2423 # The path to the ANGLE library. | |
2424 'angle_path': '<(DEPTH)/third_party/angle', | |
2425 | |
2426 # List of default apps to install in new profiles. The first list contains | |
2427 # the source files as found in svn. The second list, used only for linux, | |
2428 # contains the destination location for each of the files. When a crx | |
2429 # is added or removed from the list, the chrome/browser/resources/ | |
2430 # default_apps/external_extensions.json file must also be updated. | |
2431 # | |
2432 # README: GN version of these is in the target //chrome:default_apps | |
2433 # (there's no global variable like in GYP). Be sure to update that target | |
2434 # if you change these lists! | |
2435 'default_apps_list': [ | |
2436 'browser/resources/default_apps/external_extensions.json', | |
2437 'browser/resources/default_apps/gmail.crx', | |
2438 'browser/resources/default_apps/youtube.crx', | |
2439 'browser/resources/default_apps/drive.crx', | |
2440 'browser/resources/default_apps/docs.crx', | |
2441 ], | |
2442 'default_apps_list_linux_dest': [ | |
2443 '<(PRODUCT_DIR)/default_apps/external_extensions.json', | |
2444 '<(PRODUCT_DIR)/default_apps/gmail.crx', | |
2445 '<(PRODUCT_DIR)/default_apps/youtube.crx', | |
2446 '<(PRODUCT_DIR)/default_apps/drive.crx', | |
2447 '<(PRODUCT_DIR)/default_apps/docs.crx', | |
2448 ], | |
2449 | |
2450 # Whether to allow building of the GPU-related isolates. | |
2451 'archive_gpu_tests%': 0, | |
2452 | |
2453 # Whether to allow building of chromoting related isolates. | |
2454 'archive_chromoting_tests%': 0, | |
2455 | |
2456 # Whether to allow building of Media Router related isolates. | |
2457 'archive_media_router_tests%': 0, | |
2458 }, | |
2459 'target_defaults': { | 9 'target_defaults': { |
2460 'variables': { | 10 'default_configuration': 'Release', |
2461 # The condition that operates on chromium_code is in a target_conditions | |
2462 # section, and will not have access to the default fallback value of | |
2463 # chromium_code at the top of this file, or to the chromium_code | |
2464 # variable placed at the root variables scope of .gyp files, because | |
2465 # those variables are not set at target scope. As a workaround, | |
2466 # if chromium_code is not set at target scope, define it in target scope | |
2467 # to contain whatever value it has during early variable expansion. | |
2468 # That's enough to make it available during target conditional | |
2469 # processing. | |
2470 'chromium_code%': '<(chromium_code)', | |
2471 | |
2472 'component%': '<(component)', | |
2473 | |
2474 'chromecast%': '<(chromecast)', | |
2475 | |
2476 # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx | |
2477 'win_release_Optimization%': '2', # 2 = /O2 | |
2478 'win_debug_Optimization%': '0', # 0 = /Od | |
2479 | |
2480 # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx | |
2481 # Tri-state: blank is default, 1 on, 0 off | |
2482 'win_release_OmitFramePointers%': '0', | |
2483 # Tri-state: blank is default, 1 on, 0 off | |
2484 'win_debug_OmitFramePointers%': '', | |
2485 | |
2486 # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx | |
2487 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off | |
2488 | |
2489 # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx | |
2490 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off, | |
2491 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max | |
2492 | |
2493 # VS inserts quite a lot of extra checks to algorithms like | |
2494 # std::partial_sort in Debug build which make them O(N^2) | |
2495 # instead of O(N*logN). This is particularly slow under memory | |
2496 # tools like ThreadSanitizer so we want it to be disablable. | |
2497 # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx | |
2498 'win_debug_disable_iterator_debugging%': '0', | |
2499 | |
2500 # An application manifest fragment to declare compatibility settings for | |
2501 # 'executable' targets. Ignored in other target type. | |
2502 'win_exe_compatibility_manifest%': | |
2503 '<(DEPTH)\\build\\win\\compatibility.manifest', | |
2504 | |
2505 'release_extra_cflags%': '', | |
2506 'debug_extra_cflags%': '', | |
2507 | |
2508 'release_valgrind_build%': '<(release_valgrind_build)', | |
2509 | |
2510 # the non-qualified versions are widely assumed to be *nix-only | |
2511 'win_release_extra_cflags%': '', | |
2512 'win_debug_extra_cflags%': '', | |
2513 | |
2514 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600 | |
2515 'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)', | |
2516 | |
2517 # Only used by Windows build for now. Can be used to build into a | |
2518 # differet output directory, e.g., a build_dir_prefix of VS2010_ would | |
2519 # output files in src/build/VS2010_{Debug,Release}. | |
2520 'build_dir_prefix%': '', | |
2521 | |
2522 # Targets are by default not nacl untrusted code. | |
2523 'nacl_untrusted_build%': 0, | |
2524 | |
2525 'pnacl_compile_flags': [ | |
2526 # pnacl uses the clang compiler so we need to suppress all the | |
2527 # same warnings as we do for clang. | |
2528 # TODO(sbc): Remove these if/when they are removed from the clang | |
2529 # build. | |
2530 '-Wno-unused-function', | |
2531 '-Wno-char-subscripts', | |
2532 '-Wno-c++11-extensions', | |
2533 '-Wno-unnamed-type-template-args', | |
2534 ], | |
2535 | |
2536 # By default, Android targets have their exported JNI symbols stripped, | |
2537 # so we test the manual JNI registration code paths that are required | |
2538 # when using the crazy linker. To allow use of native JNI exports (lazily | |
2539 # resolved by the JVM), targets can enable this variable, which will stop | |
2540 # the stripping from happening. Only targets which do not need to be | |
2541 # compatible with the crazy linker are permitted to set this. | |
2542 'use_native_jni_exports%': 0, | |
2543 | |
2544 'conditions': [ | |
2545 ['OS=="win" and component=="shared_library"', { | |
2546 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx | |
2547 'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL) | |
2548 'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL) | |
2549 }, { | |
2550 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx | |
2551 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static) | |
2552 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static) | |
2553 }], | |
2554 ['OS=="ios"', { | |
2555 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.htm
l | |
2556 'mac_release_optimization%': 's', # Use -Os unless overridden | |
2557 'mac_debug_optimization%': '0', # Use -O0 unless overridden | |
2558 }, { | |
2559 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.htm
l | |
2560 'mac_release_optimization%': '2', # Use -O2 unless overridden | |
2561 'mac_debug_optimization%': '0', # Use -O0 unless overridden | |
2562 }], | |
2563 ['OS=="android"', { | |
2564 'host_os%': '<(host_os)', # See comment above chromium_code. | |
2565 }], | |
2566 ], | |
2567 'clang_warning_flags': [ | |
2568 '-Wheader-hygiene', | |
2569 | |
2570 # TODO(thakis): Consider -Wloop-analysis (turns on | |
2571 # -Wrange-loop-analysis too). | |
2572 | |
2573 # Don't die on dtoa code that uses a char as an array index. | |
2574 # This is required solely for base/third_party/dmg_fp/dtoa.cc. | |
2575 '-Wno-char-subscripts', | |
2576 | |
2577 # TODO(thakis): This used to be implied by -Wno-unused-function, | |
2578 # which we no longer use. Check if it makes sense to remove | |
2579 # this as well. http://crbug.com/316352 | |
2580 '-Wno-unneeded-internal-declaration', | |
2581 | |
2582 # Warns on switches on enums that cover all enum values but | |
2583 # also contain a default: branch. Chrome is full of that. | |
2584 '-Wno-covered-switch-default', | |
2585 | |
2586 # Warns when a const char[] is converted to bool. | |
2587 '-Wstring-conversion', | |
2588 | |
2589 # C++11-related flags: | |
2590 | |
2591 # This warns on using ints as initializers for floats in | |
2592 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|), | |
2593 # which happens in several places in chrome code. Not sure if | |
2594 # this is worth fixing. | |
2595 '-Wno-c++11-narrowing', | |
2596 | |
2597 # Clang considers the `register` keyword as deprecated, but e.g. | |
2598 # code generated by flex (used in angle) contains that keyword. | |
2599 # http://crbug.com/255186 | |
2600 '-Wno-deprecated-register', | |
2601 | |
2602 # TODO(hans): Get this cleaned up, http://crbug.com/428099 | |
2603 '-Wno-inconsistent-missing-override', | |
2604 | |
2605 # TODO(thakis): Enable this, crbug.com/507717 | |
2606 '-Wno-shift-negative-value', | |
2607 | |
2608 # TODO(thakis): https://crbug.com/604888 | |
2609 '-Wno-undefined-var-template', | |
2610 | |
2611 # TODO(thakis): https://crbug.com/617318 | |
2612 '-Wno-nonportable-include-path', | |
2613 ], | |
2614 }, | |
2615 'defines': [ | |
2616 # Don't use deprecated V8 APIs anywhere. | |
2617 'V8_DEPRECATION_WARNINGS', | |
2618 ], | |
2619 'include_dirs': [ | |
2620 '<(SHARED_INTERMEDIATE_DIR)', | |
2621 ], | |
2622 'conditions': [ | |
2623 ['OS=="mac"', { | |
2624 # When compiling Objective C, warns if a method is used whose | |
2625 # availability is newer than the deployment target. | |
2626 'xcode_settings': { 'WARNING_CFLAGS': ['-Wpartial-availability']}, | |
2627 }], | |
2628 ['(OS=="mac" or OS=="ios") and asan==1', { | |
2629 'dependencies': [ | |
2630 '<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime', | |
2631 ], | |
2632 }], | |
2633 ['OS=="win" and asan==1 and component=="shared_library"', { | |
2634 'dependencies': [ | |
2635 '<(DEPTH)/build/win/asan.gyp:asan_dynamic_runtime', | |
2636 ], | |
2637 }], | |
2638 ['branding=="Chrome"', { | |
2639 'defines': ['GOOGLE_CHROME_BUILD'], | |
2640 }, { # else: branding!="Chrome" | |
2641 'defines': ['CHROMIUM_BUILD'], | |
2642 }], | |
2643 ['OS=="mac" and component=="shared_library"', { | |
2644 'xcode_settings': { | |
2645 'DYLIB_INSTALL_NAME_BASE': '@rpath', | |
2646 'LD_RUNPATH_SEARCH_PATHS': [ | |
2647 # For unbundled binaries. | |
2648 '@loader_path/.', | |
2649 # For bundled binaries, to get back from Binary.app/Contents/MacOS. | |
2650 '@loader_path/../../..', | |
2651 ], | |
2652 }, | |
2653 }], | |
2654 ['clang==1 or host_clang==1', { | |
2655 # This is here so that all files get recompiled after a clang roll and | |
2656 # when turning clang on or off. | |
2657 # (defines are passed via the command line, and build systems rebuild | |
2658 # things when their commandline changes). Nothing should ever read this | |
2659 # define. | |
2660 'defines': ['CR_CLANG_REVISION=<!(python <(DEPTH)/tools/clang/scripts/up
date.py --print-revision)'], | |
2661 }], | |
2662 ['enable_rlz==1', { | |
2663 'defines': ['ENABLE_RLZ'], | |
2664 }], | |
2665 ['component=="shared_library"', { | |
2666 'defines': ['COMPONENT_BUILD'], | |
2667 }], | |
2668 ['ui_compositor_image_transport==1', { | |
2669 'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'], | |
2670 }], | |
2671 ['use_aura==1', { | |
2672 'defines': ['USE_AURA=1'], | |
2673 }], | |
2674 ['use_ash==1', { | |
2675 'defines': ['USE_ASH=1'], | |
2676 }], | |
2677 ['use_pango==1', { | |
2678 'defines': ['USE_PANGO=1'], | |
2679 }], | |
2680 ['use_cairo==1', { | |
2681 'defines': ['USE_CAIRO=1'], | |
2682 }], | |
2683 ['use_cras==1', { | |
2684 'defines': ['USE_CRAS=1'], | |
2685 }], | |
2686 ['use_ozone==1', { | |
2687 'defines': ['USE_OZONE=1'], | |
2688 }], | |
2689 ['use_default_render_theme==1', { | |
2690 'defines': ['USE_DEFAULT_RENDER_THEME=1'], | |
2691 }], | |
2692 ['use_libjpeg_turbo==1', { | |
2693 'defines': ['USE_LIBJPEG_TURBO=1'], | |
2694 }], | |
2695 ['use_x11==1', { | |
2696 'defines': ['USE_X11=1'], | |
2697 }], | |
2698 ['use_clipboard_aurax11==1', { | |
2699 'defines': ['USE_CLIPBOARD_AURAX11=1'], | |
2700 }], | |
2701 ['image_loader_extension==1', { | |
2702 'defines': ['IMAGE_LOADER_EXTENSION=1'], | |
2703 }], | |
2704 ['enable_webrtc==1', { | |
2705 'defines': ['ENABLE_WEBRTC=1'], | |
2706 }], | |
2707 ['enable_media_router==1', { | |
2708 'defines': ['ENABLE_MEDIA_ROUTER=1'], | |
2709 }], | |
2710 ['proprietary_codecs==1', { | |
2711 'defines': ['USE_PROPRIETARY_CODECS'], | |
2712 }], | |
2713 ['enable_viewport==1', { | |
2714 'defines': ['ENABLE_VIEWPORT'], | |
2715 }], | |
2716 ['enable_pepper_cdms==1', { | |
2717 'defines': ['ENABLE_PEPPER_CDMS'], | |
2718 }], | |
2719 ['enable_browser_cdms==1', { | |
2720 'defines': ['ENABLE_BROWSER_CDMS'], | |
2721 }], | |
2722 ['notifications==1', { | |
2723 'defines': ['ENABLE_NOTIFICATIONS'], | |
2724 }], | |
2725 ['enable_wayland_server==1', { | |
2726 'defines': ['ENABLE_WAYLAND_SERVER=1'], | |
2727 }], | |
2728 ['enable_wifi_display==1', { | |
2729 'defines': ['ENABLE_WIFI_DISPLAY=1'], | |
2730 }], | |
2731 ['use_udev==1', { | |
2732 'defines': ['USE_UDEV'], | |
2733 }], | |
2734 ['use_external_popup_menu==1', { | |
2735 'defines': ['USE_EXTERNAL_POPUP_MENU'], | |
2736 }], | |
2737 ['fastbuild!=0', { | |
2738 'xcode_settings': { | |
2739 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO', | |
2740 }, | |
2741 'conditions': [ | |
2742 ['OS=="win" and fastbuild==2', { | |
2743 # Completely disable debug information. | |
2744 'msvs_settings': { | |
2745 'VCLinkerTool': { | |
2746 'GenerateDebugInformation': 'false', | |
2747 }, | |
2748 'VCCLCompilerTool': { | |
2749 'DebugInformationFormat': '0', | |
2750 }, | |
2751 }, | |
2752 }], | |
2753 ['OS=="win" and fastbuild==1', { | |
2754 'msvs_settings': { | |
2755 'VCLinkerTool': { | |
2756 # This tells the linker to generate .pdbs, so that | |
2757 # we can get meaningful stack traces. | |
2758 'GenerateDebugInformation': 'true', | |
2759 }, | |
2760 'VCCLCompilerTool': { | |
2761 # No debug info to be generated by compiler. | |
2762 'DebugInformationFormat': '0', | |
2763 }, | |
2764 }, | |
2765 }], | |
2766 ['(OS=="android" or OS=="linux") and fastbuild==2', { | |
2767 'variables': { 'debug_extra_cflags': '-g0', }, | |
2768 }], | |
2769 ['(OS=="android" or OS=="linux") and fastbuild==1', { | |
2770 # TODO(thakis): Change this to -g1 once http://crbug.com/456947 is | |
2771 # fixed. | |
2772 'variables': { 'debug_extra_cflags': '-g0', }, | |
2773 }], | |
2774 # Android builds symbols on release by default, disable them. | |
2775 ['OS=="android" and fastbuild==2', { | |
2776 'variables': { 'release_extra_cflags': '-g0', }, | |
2777 }], | |
2778 ['OS=="android" and fastbuild==1', { | |
2779 # TODO(thakis): Change this to -g1 once http://crbug.com/456947 is | |
2780 # fixed. | |
2781 'variables': { 'release_extra_cflags': '-g0', }, | |
2782 }], | |
2783 ], | |
2784 }], # fastbuild!=0 | |
2785 ['dcheck_always_on!=0', { | |
2786 'defines': ['DCHECK_ALWAYS_ON=1'], | |
2787 }], # dcheck_always_on!=0 | |
2788 ['tracing_like_official_build!=0', { | |
2789 'defines': ['TRACING_IS_OFFICIAL_BUILD=1'], | |
2790 }], # tracing_like_official_build!=0 | |
2791 ['fieldtrial_testing_like_official_build==0 and branding!="Chrome"', { | |
2792 'defines': ['FIELDTRIAL_TESTING_ENABLED'], | |
2793 }], # fieldtrial_testing_like_official_build==0 and branding!="Chrome" | |
2794 ['OS=="win"', { | |
2795 'defines': ['NO_TCMALLOC'], | |
2796 }], | |
2797 ['syzyasan==1', { | |
2798 # SyzyAsan needs /PROFILE turned on to produce appropriate pdbs. | |
2799 'msvs_settings': { | |
2800 'VCLinkerTool': { | |
2801 'Profile': 'true', | |
2802 }, | |
2803 }, | |
2804 'defines': [ | |
2805 'SYZYASAN', | |
2806 'MEMORY_TOOL_REPLACES_ALLOCATOR', | |
2807 'MEMORY_SANITIZER_INITIAL_SIZE', | |
2808 ], | |
2809 }], | |
2810 ['OS=="win"', { | |
2811 'defines': [ | |
2812 '__STD_C', | |
2813 '_CRT_SECURE_NO_DEPRECATE', | |
2814 '_SCL_SECURE_NO_DEPRECATE', | |
2815 # This define is required to pull in the new Win 10 interfaces from | |
2816 # system headers like ShObjIdl.h. | |
2817 'NTDDI_VERSION=0x0A000000', | |
2818 # This is required for ATL to use XP-safe versions of its functions. | |
2819 '_USING_V110_SDK71_', | |
2820 ], | |
2821 'include_dirs': [ | |
2822 '<(DEPTH)/third_party/wtl/include', | |
2823 ], | |
2824 'conditions': [ | |
2825 ['win_z7!=0', { | |
2826 'msvs_settings': { | |
2827 # Generates debug info when win_z7=1 | |
2828 # even if fastbuild=1 (that makes GenerateDebugInformation false). | |
2829 'VCLinkerTool': { | |
2830 'GenerateDebugInformation': 'true', | |
2831 }, | |
2832 'VCCLCompilerTool': { | |
2833 'DebugInformationFormat': '1', | |
2834 } | |
2835 } | |
2836 }], # win_z7!=0 | |
2837 ['win_analyze', { | |
2838 'defines!': [ | |
2839 # This is prohibited when running /analyze. | |
2840 '_USING_V110_SDK71_', | |
2841 ], | |
2842 'msvs_settings': { | |
2843 'VCCLCompilerTool': { | |
2844 # Set WarnAsError to false to disable this setting for most | |
2845 # projects so that compilation continues. | |
2846 'WarnAsError': 'false', | |
2847 # When win_analyze is specified add the /analyze switch. | |
2848 # Also add /WX- to force-disable WarnAsError for projects that | |
2849 # override WarnAsError. | |
2850 # Also, disable various noisy warnings that have low value. | |
2851 'AdditionalOptions': [ | |
2852 '/analyze:WX-', | |
2853 '/wd6011', # Dereferencing NULL pointer | |
2854 '/wd6312', # Possible infinite loop: use of the constant | |
2855 # EXCEPTION_CONTINUE_EXECUTION in the exception-filter | |
2856 '/wd6326', # Potential comparison of constant with constant | |
2857 '/wd28159', # Consider using 'GetTickCount64' | |
2858 '/wd28204', # Inconsistent SAL annotations | |
2859 '/wd28251', # Inconsistent SAL annotations | |
2860 '/wd28252', # Inconsistent SAL annotations | |
2861 '/wd28253', # Inconsistent SAL annotations | |
2862 '/wd28196', # The precondition is not satisfied | |
2863 '/wd28301', # Inconsistent SAL annotations | |
2864 '/wd6340', # Sign mismatch in function parameter | |
2865 '/wd28182', # Dereferencing NULL pointer | |
2866 # C6285 is ~16% of raw warnings and has low value | |
2867 '/wd6285', # non-zero constant || non-zero constant | |
2868 # C6334 is ~80% of raw warnings and has low value | |
2869 '/wd6334', # sizeof applied to an expression with an operator | |
2870 ], | |
2871 }, | |
2872 }, | |
2873 }], # win_analyze | |
2874 ], | |
2875 }], # OS==win | |
2876 ['chromecast==1', { | |
2877 'defines': [ | |
2878 'LOG_DISABLED=0', | |
2879 ], | |
2880 }], | |
2881 ['enable_task_manager==1', { | |
2882 'defines': [ | |
2883 'ENABLE_TASK_MANAGER=1', | |
2884 ], | |
2885 }], | |
2886 ['enable_extensions==1', { | |
2887 'defines': [ | |
2888 'ENABLE_EXTENSIONS=1', | |
2889 ], | |
2890 }], | |
2891 ['OS=="win" and branding=="Chrome"', { | |
2892 'defines': ['ENABLE_SWIFTSHADER'], | |
2893 }], | |
2894 ['enable_dart==1', { | |
2895 'defines': ['WEBKIT_USING_DART=1'], | |
2896 }], | |
2897 ['enable_pdf==1', { | |
2898 'defines': ['ENABLE_PDF=1'], | |
2899 }], | |
2900 ['enable_plugin_installation==1', { | |
2901 'defines': ['ENABLE_PLUGIN_INSTALLATION=1'], | |
2902 }], | |
2903 ['enable_plugins==1', { | |
2904 'defines': ['ENABLE_PLUGINS=1'], | |
2905 }], | |
2906 ['enable_session_service==1', { | |
2907 'defines': ['ENABLE_SESSION_SERVICE=1'], | |
2908 }], | |
2909 ['enable_themes==1', { | |
2910 'defines': ['ENABLE_THEMES=1'], | |
2911 }], | |
2912 ['enable_basic_printing==1 or enable_print_preview==1', { | |
2913 # Convenience define for ENABLE_BASIC_PRINTING || ENABLE_PRINT_PREVIEW. | |
2914 'defines': ['ENABLE_PRINTING=1'], | |
2915 }], | |
2916 ['enable_basic_printing==1', { | |
2917 # Enable basic printing support and UI. | |
2918 'defines': ['ENABLE_BASIC_PRINTING=1'], | |
2919 }], | |
2920 ['enable_print_preview==1', { | |
2921 # Enable printing with print preview. | |
2922 # Can be defined without ENABLE_BASIC_PRINTING. | |
2923 'defines': ['ENABLE_PRINT_PREVIEW=1'], | |
2924 }], | |
2925 ['enable_spellcheck==1', { | |
2926 'defines': ['ENABLE_SPELLCHECK=1'], | |
2927 }], | |
2928 ['use_browser_spellchecker', { | |
2929 'defines': ['USE_BROWSER_SPELLCHECKER=1'], | |
2930 }], | |
2931 ['use_minikin_hyphenation', { | |
2932 'defines': ['USE_MINIKIN_HYPHENATION=1'], | |
2933 }], | |
2934 ['enable_captive_portal_detection==1', { | |
2935 'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'], | |
2936 }], | |
2937 ['enable_app_list==1', { | |
2938 'defines': ['ENABLE_APP_LIST=1'], | |
2939 }], | |
2940 ['disable_file_support==1', { | |
2941 'defines': ['DISABLE_FILE_SUPPORT=1'], | |
2942 }], | |
2943 ['disable_ftp_support==1', { | |
2944 'defines': ['DISABLE_FTP_SUPPORT=1'], | |
2945 }], | |
2946 ['enable_supervised_users==1', { | |
2947 'defines': ['ENABLE_SUPERVISED_USERS=1'], | |
2948 }], | |
2949 ['enable_mdns==1', { | |
2950 'defines': ['ENABLE_MDNS=1'], | |
2951 }], | |
2952 ['enable_service_discovery==1', { | |
2953 'defines' : [ 'ENABLE_SERVICE_DISCOVERY=1' ], | |
2954 }], | |
2955 ['enable_hangout_services_extension==1', { | |
2956 'defines': ['ENABLE_HANGOUT_SERVICES_EXTENSION=1'], | |
2957 }], | |
2958 ['enable_ipc_fuzzer==1', { | |
2959 'defines': ['ENABLE_IPC_FUZZER=1'], | |
2960 }], | |
2961 ['v8_use_external_startup_data==1', { | |
2962 'defines': ['V8_USE_EXTERNAL_STARTUP_DATA'], | |
2963 }], | |
2964 ['enable_webvr==1', { | |
2965 'defines': ['ENABLE_WEBVR'], | |
2966 }], | |
2967 | |
2968 # SAFE_BROWSING_DB_LOCAL - service manages a local database. | |
2969 # SAFE_BROWSING_DB_REMOTE - service talks via API to a database | |
2970 # SAFE_BROWSING_CSD - enable client-side phishing detection. | |
2971 ['safe_browsing==1', { | |
2972 'defines': [ | |
2973 # TODO(nparker): Remove existing uses of FULL_SAFE_BROWSING | |
2974 'FULL_SAFE_BROWSING', | |
2975 'SAFE_BROWSING_CSD', | |
2976 'SAFE_BROWSING_DB_LOCAL', | |
2977 ], | |
2978 }], | |
2979 ['safe_browsing==2 and OS!="ios"', { | |
2980 'defines': [ | |
2981 'SAFE_BROWSING_DB_REMOTE', | |
2982 ], | |
2983 }], | |
2984 ], # conditions for 'target_defaults' | |
2985 'target_conditions': [ | |
2986 ['<(use_libpci)==1', { | |
2987 'defines': ['USE_LIBPCI=1'], | |
2988 }], | |
2989 ['<(use_openssl_certs)==1', { | |
2990 'defines': ['USE_OPENSSL_CERTS=1'], | |
2991 }], | |
2992 ['>(nacl_untrusted_build)==1', { | |
2993 'defines': [ | |
2994 'USE_OPENSSL_CERTS=1', | |
2995 ], | |
2996 }], | |
2997 ['<(use_glib)==1 and >(nacl_untrusted_build)==0', { | |
2998 'defines': ['USE_GLIB=1'], | |
2999 }], | |
3000 ['<(use_nss_certs)==1 and >(nacl_untrusted_build)==0', { | |
3001 'defines': ['USE_NSS_CERTS=1'], | |
3002 }], | |
3003 ['<(chromeos)==1 and >(nacl_untrusted_build)==0', { | |
3004 'defines': ['OS_CHROMEOS=1'], | |
3005 }], | |
3006 ['<(asan)==1 and >(nacl_untrusted_build)==0', { | |
3007 'defines': [ | |
3008 'ADDRESS_SANITIZER', | |
3009 'MEMORY_TOOL_REPLACES_ALLOCATOR', | |
3010 'MEMORY_SANITIZER_INITIAL_SIZE', | |
3011 ], | |
3012 }], | |
3013 ['enable_wexit_time_destructors==1 and OS!="win"', { | |
3014 # TODO: Enable on Windows too, http://crbug.com/404525 | |
3015 'variables': { 'clang_warning_flags': ['-Wexit-time-destructors']}, | |
3016 }], | |
3017 ['chromium_code==0', { | |
3018 'variables': { | |
3019 'clang_warning_flags': [ | |
3020 # Lots of third-party libraries have unused variables. Instead of | |
3021 # suppressing them individually, we just blanket suppress them here. | |
3022 '-Wno-unused-variable', | |
3023 ], | |
3024 }, | |
3025 'conditions': [ | |
3026 [ 'os_posix==1 and OS!="mac" and OS!="ios"', { | |
3027 # Remove -Wextra for third-party code. | |
3028 'cflags!': [ '-Wextra' ], | |
3029 'cflags_cc': [ | |
3030 # Don't warn about hash_map in third-party code. | |
3031 '-Wno-deprecated', | |
3032 ], | |
3033 }], | |
3034 [ 'os_posix==1 and clang!=1 and OS!="mac" and OS!="ios"', { | |
3035 # When we don't control the compiler, don't use -Wall for | |
3036 # third-party code either. | |
3037 'cflags!': [ '-Wall' ], | |
3038 }], | |
3039 # TODO: Fix all warnings on chromeos too. | |
3040 [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==
1)', { | |
3041 'cflags!': [ | |
3042 '-Werror', | |
3043 ], | |
3044 }], | |
3045 [ 'OS=="win"', { | |
3046 'defines': [ | |
3047 '_CRT_SECURE_NO_DEPRECATE', | |
3048 '_CRT_NONSTDC_NO_WARNINGS', | |
3049 '_CRT_NONSTDC_NO_DEPRECATE', | |
3050 '_SCL_SECURE_NO_DEPRECATE', | |
3051 ], | |
3052 'msvs_disabled_warnings': [ | |
3053 # forcing value to bool 'true' or 'false' (performance warning) | |
3054 4800, | |
3055 ], | |
3056 'msvs_settings': { | |
3057 'VCCLCompilerTool': { | |
3058 'WarningLevel': '3', | |
3059 'WarnAsError': 'true', | |
3060 'Detect64BitPortabilityProblems': 'false', | |
3061 }, | |
3062 }, | |
3063 'conditions': [ | |
3064 ['buildtype=="Official"', { | |
3065 'msvs_settings': { | |
3066 'VCCLCompilerTool': { 'WarnAsError': 'false' }, | |
3067 } | |
3068 }], | |
3069 [ 'component=="shared_library"', { | |
3070 # TODO(darin): Unfortunately, some third_party code depends on bas
e. | |
3071 'msvs_disabled_warnings': [ | |
3072 4251, # class 'std::xx' needs to have dll-interface. | |
3073 ], | |
3074 }], | |
3075 ], | |
3076 }], | |
3077 | |
3078 [ 'OS=="mac" or OS=="ios"', { | |
3079 'xcode_settings': { | |
3080 'WARNING_CFLAGS!': ['-Wextra'], | |
3081 }, | |
3082 'conditions': [ | |
3083 ['buildtype=="Official"', { | |
3084 'xcode_settings': { | |
3085 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror | |
3086 }, | |
3087 }], | |
3088 ], | |
3089 }], | |
3090 [ 'OS=="ios"', { | |
3091 'xcode_settings': { | |
3092 'RUN_CLANG_STATIC_ANALYZER': 'NO', | |
3093 # Several internal ios directories generate numerous warnings for | |
3094 # -Wobjc-missing-property-synthesis. | |
3095 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO', | |
3096 }, | |
3097 }], | |
3098 ], | |
3099 }, { | |
3100 # In Chromium code, we define __STDC_foo_MACROS in order to get the | |
3101 # C99 macros on Mac and Linux. | |
3102 'defines': [ | |
3103 '__STDC_CONSTANT_MACROS', | |
3104 '__STDC_FORMAT_MACROS', | |
3105 ], | |
3106 'conditions': [ | |
3107 ['OS=="win"', { | |
3108 # turn on warnings for signed/unsigned mismatch on chromium code. | |
3109 'msvs_settings': { | |
3110 'VCCLCompilerTool': { | |
3111 'AdditionalOptions': ['/we4389'], | |
3112 }, | |
3113 }, | |
3114 }], | |
3115 ['OS=="win" and component=="shared_library"', { | |
3116 'msvs_disabled_warnings': [ | |
3117 4251, # class 'std::xx' needs to have dll-interface. | |
3118 ], | |
3119 }], | |
3120 ], | |
3121 }], | |
3122 ], # target_conditions for 'target_defaults' | |
3123 'default_configuration': 'Debug', | |
3124 'configurations': { | 11 'configurations': { |
3125 # VCLinkerTool LinkIncremental values below: | 12 'Release': {}, |
3126 # 0 == default | |
3127 # 1 == /INCREMENTAL:NO | |
3128 # 2 == /INCREMENTAL | |
3129 # Debug links incremental, Release does not. | |
3130 # | |
3131 # Abstract base configurations to cover common attributes. | |
3132 # | |
3133 'Common_Base': { | |
3134 'abstract': 1, | |
3135 'msvs_configuration_attributes': { | |
3136 'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(Configuratio
nName)', | |
3137 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)', | |
3138 'CharacterSet': '1', | |
3139 }, | |
3140 'msvs_settings':{ | |
3141 'VCCLCompilerTool': { | |
3142 'AdditionalOptions': [ | |
3143 '/bigobj', | |
3144 # Tell the compiler to crash on failures. This is undocumented | |
3145 # and unsupported but very handy. | |
3146 '/d2FastFail', | |
3147 ], | |
3148 }, | |
3149 'VCLinkerTool': { | |
3150 # Add the default import libs. | |
3151 'AdditionalDependencies': [ | |
3152 'kernel32.lib', | |
3153 'gdi32.lib', | |
3154 'winspool.lib', | |
3155 'comdlg32.lib', | |
3156 'advapi32.lib', | |
3157 'shell32.lib', | |
3158 'ole32.lib', | |
3159 'oleaut32.lib', | |
3160 'user32.lib', | |
3161 'uuid.lib', | |
3162 'odbc32.lib', | |
3163 'odbccp32.lib', | |
3164 'delayimp.lib', | |
3165 'credui.lib', | |
3166 ], | |
3167 'AdditionalOptions': [ | |
3168 # Suggested by Microsoft Devrel to avoid | |
3169 # LINK : fatal error LNK1248: image size (80000000) exceeds maxi
mum allowable size (80000000) | |
3170 # which started happening more regularly after VS2013 Update 4. | |
3171 # Needs to be a bit lower for VS2015, or else errors out. | |
3172 '/maxilksize:0x7ff00000', | |
3173 # Tell the linker to crash on failures. | |
3174 '/fastfail', | |
3175 ], | |
3176 }, | |
3177 }, | |
3178 'conditions': [ | |
3179 ['OS=="win" and win_fastlink==1 and MSVS_VERSION != "2013"', { | |
3180 'msvs_settings': { | |
3181 'VCLinkerTool': { | |
3182 # /PROFILE is incompatible with /debug:fastlink | |
3183 'Profile': 'false', | |
3184 'AdditionalOptions': [ | |
3185 # Tell VS 2015+ to create a PDB that references debug | |
3186 # information in .obj and .lib files instead of copying | |
3187 # it all. | |
3188 '/DEBUG:FASTLINK', | |
3189 ], | |
3190 }, | |
3191 }, | |
3192 }], | |
3193 ['OS=="win" and MSVS_VERSION == "2015"', { | |
3194 'msvs_settings': { | |
3195 'VCCLCompilerTool': { | |
3196 'AdditionalOptions': [ | |
3197 # Work around crbug.com/526851, bug in VS 2015 RTM compiler. | |
3198 '/Zc:sizedDealloc-', | |
3199 # Disable thread-safe statics to avoid overhead and because | |
3200 # they are disabled on other platforms. See crbug.com/587210 | |
3201 # and -fno-threadsafe-statics. | |
3202 '/Zc:threadSafeInit-', | |
3203 ], | |
3204 }, | |
3205 }, | |
3206 }], | |
3207 ], | |
3208 }, | |
3209 'x86_Base': { | |
3210 'abstract': 1, | |
3211 'msvs_settings': { | |
3212 'VCLinkerTool': { | |
3213 'MinimumRequiredVersion': '5.01', # XP. | |
3214 'TargetMachine': '1', | |
3215 }, | |
3216 'VCLibrarianTool': { | |
3217 'TargetMachine': '1', | |
3218 }, | |
3219 }, | |
3220 'msvs_configuration_platform': 'Win32', | |
3221 }, | |
3222 'x64_Base': { | |
3223 'abstract': 1, | |
3224 'msvs_configuration_platform': 'x64', | |
3225 'msvs_settings': { | |
3226 'VCLinkerTool': { | |
3227 # Make sure to understand http://crbug.com/361720 if you want to | |
3228 # increase this. | |
3229 'MinimumRequiredVersion': '5.02', # Server 2003. | |
3230 'TargetMachine': '17', # x86 - 64 | |
3231 'AdditionalLibraryDirectories!': | |
3232 ['<(windows_sdk_path)/Lib/10.0.10586.0/um/x86'], | |
3233 'AdditionalLibraryDirectories': | |
3234 ['<(windows_sdk_path)/Lib/10.0.10586.0/um/x64'], | |
3235 # Doesn't exist x64 SDK. Should use oleaut32 in any case. | |
3236 'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ], | |
3237 }, | |
3238 'VCLibrarianTool': { | |
3239 'AdditionalLibraryDirectories!': | |
3240 ['<(windows_sdk_path)/Lib/10.0.10586.0/um/x86'], | |
3241 'AdditionalLibraryDirectories': | |
3242 ['<(windows_sdk_path)/Lib/10.0.10586.0/um/x64'], | |
3243 'TargetMachine': '17', # x64 | |
3244 }, | |
3245 }, | |
3246 }, | |
3247 'Debug_Base': { | |
3248 'abstract': 1, | |
3249 'defines': [ | |
3250 'DYNAMIC_ANNOTATIONS_ENABLED=1', | |
3251 'WTF_USE_DYNAMIC_ANNOTATIONS=1', | |
3252 ], | |
3253 'xcode_settings': { | |
3254 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)', | |
3255 'OTHER_CFLAGS': [ | |
3256 '<@(debug_extra_cflags)', | |
3257 ], | |
3258 }, | |
3259 'msvs_settings': { | |
3260 'VCCLCompilerTool': { | |
3261 'Optimization': '<(win_debug_Optimization)', | |
3262 'PreprocessorDefinitions': ['_DEBUG'], | |
3263 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)', | |
3264 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)', | |
3265 'conditions': [ | |
3266 # According to MSVS, InlineFunctionExpansion=0 means | |
3267 # "default inlining", not "/Ob0". | |
3268 # Thus, we have to handle InlineFunctionExpansion==0 separately. | |
3269 ['win_debug_InlineFunctionExpansion==0', { | |
3270 'AdditionalOptions': ['/Ob0'], | |
3271 }], | |
3272 ['win_debug_InlineFunctionExpansion!=""', { | |
3273 'InlineFunctionExpansion': | |
3274 '<(win_debug_InlineFunctionExpansion)', | |
3275 }], | |
3276 ['win_debug_disable_iterator_debugging==1', { | |
3277 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'], | |
3278 }], | |
3279 | |
3280 # if win_debug_OmitFramePointers is blank, leave as default | |
3281 ['win_debug_OmitFramePointers==1', { | |
3282 'OmitFramePointers': 'true', | |
3283 }], | |
3284 ['win_debug_OmitFramePointers==0', { | |
3285 'OmitFramePointers': 'false', | |
3286 # The above is not sufficient (http://crbug.com/106711): it | |
3287 # simply eliminates an explicit "/Oy", but both /O2 and /Ox | |
3288 # perform FPO regardless, so we must explicitly disable. | |
3289 # We still want the false setting above to avoid having | |
3290 # "/Oy /Oy-" and warnings about overriding. | |
3291 'AdditionalOptions': ['/Oy-'], | |
3292 }], | |
3293 ], | |
3294 'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ], | |
3295 }, | |
3296 'VCLinkerTool': { | |
3297 'LinkIncremental': '<(msvs_debug_link_incremental)', | |
3298 # ASLR makes debugging with windbg difficult because Chrome.exe and | |
3299 # Chrome.dll share the same base name. As result, windbg will | |
3300 # name the Chrome.dll module like chrome_<base address>, where | |
3301 # <base address> typically changes with each launch. This in turn | |
3302 # means that breakpoints in Chrome.dll don't stick from one launch | |
3303 # to the next. For this reason, we turn ASLR off in debug builds. | |
3304 # Note that this is a three-way bool, where 0 means to pick up | |
3305 # the default setting, 1 is off and 2 is on. | |
3306 'RandomizedBaseAddress': 1, | |
3307 }, | |
3308 'VCResourceCompilerTool': { | |
3309 'PreprocessorDefinitions': ['_DEBUG'], | |
3310 }, | |
3311 }, | |
3312 'variables': { | |
3313 'clang_warning_flags': [ | |
3314 # Allow comparing the address of references and 'this' against 0 | |
3315 # in debug builds. Technically, these can never be null in | |
3316 # well-defined C/C++ and Clang can optimize such checks away in | |
3317 # release builds, but they may be used in asserts in debug builds. | |
3318 '-Wno-undefined-bool-conversion', | |
3319 '-Wno-tautological-undefined-compare', | |
3320 ], | |
3321 }, | |
3322 'conditions': [ | |
3323 ['OS=="linux" or OS=="android"', { | |
3324 'target_conditions': [ | |
3325 ['_toolset=="target"', { | |
3326 'cflags': [ | |
3327 '<@(debug_extra_cflags)', | |
3328 ], | |
3329 }], | |
3330 ], | |
3331 }], | |
3332 ['OS=="linux" and target_arch!="ia32" and disable_glibcxx_debug==0', { | |
3333 # Enable libstdc++ debugging facilities to help catch problems | |
3334 # early, see http://crbug.com/65151 . | |
3335 # TODO(phajdan.jr): Should we enable this for all of POSIX? | |
3336 'defines': ['_GLIBCXX_DEBUG=1',], | |
3337 }], | |
3338 ['release_valgrind_build==0', { | |
3339 'xcode_settings': { | |
3340 'OTHER_CFLAGS': [ | |
3341 '-fstack-protector-strong', # Implies -fstack-protector | |
3342 ], | |
3343 }, | |
3344 }], | |
3345 ], | |
3346 }, | |
3347 'Release_Base': { | |
3348 'abstract': 1, | |
3349 'defines': [ | |
3350 'NDEBUG', | |
3351 ], | |
3352 'xcode_settings': { | |
3353 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip | |
3354 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)', | |
3355 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ], | |
3356 }, | |
3357 'msvs_settings': { | |
3358 'VCCLCompilerTool': { | |
3359 'RuntimeLibrary': '<(win_release_RuntimeLibrary)', | |
3360 'conditions': [ | |
3361 # In official builds, each target will self-select | |
3362 # an optimization level. | |
3363 ['buildtype!="Official"', { | |
3364 'Optimization': '<(win_release_Optimization)', | |
3365 }, | |
3366 ], | |
3367 # According to MSVS, InlineFunctionExpansion=0 means | |
3368 # "default inlining", not "/Ob0". | |
3369 # Thus, we have to handle InlineFunctionExpansion==0 separately. | |
3370 ['win_release_InlineFunctionExpansion==0', { | |
3371 'AdditionalOptions': ['/Ob0'], | |
3372 }], | |
3373 ['win_release_InlineFunctionExpansion!=""', { | |
3374 'InlineFunctionExpansion': | |
3375 '<(win_release_InlineFunctionExpansion)', | |
3376 }], | |
3377 | |
3378 # if win_release_OmitFramePointers is blank, leave as default | |
3379 ['win_release_OmitFramePointers==1', { | |
3380 'OmitFramePointers': 'true', | |
3381 }], | |
3382 ['win_release_OmitFramePointers==0', { | |
3383 'OmitFramePointers': 'false', | |
3384 # The above is not sufficient (http://crbug.com/106711): it | |
3385 # simply eliminates an explicit "/Oy", but both /O2 and /Ox | |
3386 # perform FPO regardless, so we must explicitly disable. | |
3387 # We still want the false setting above to avoid having | |
3388 # "/Oy /Oy-" and warnings about overriding. | |
3389 'AdditionalOptions': ['/Oy-'], | |
3390 }], | |
3391 ['asan==0', { | |
3392 # Put data in separate COMDATs. This allows the linker | |
3393 # to put bit-identical constants at the same address even if | |
3394 # they're unrelated constants, which saves binary size. | |
3395 # This optimization can't be used when ASan is enabled because | |
3396 # it is not compatible with the ASan ODR checker. | |
3397 'AdditionalOptions': ['/Gw'], | |
3398 }], | |
3399 ], | |
3400 'AdditionalOptions': [ | |
3401 '/d2Zi+', # Improve debugging of Release builds. | |
3402 '/Zc:inline', # Remove unreferenced COMDAT (faster links). | |
3403 '<@(win_release_extra_cflags)', | |
3404 ], | |
3405 }, | |
3406 'VCLinkerTool': { | |
3407 # LinkIncremental is a tri-state boolean, where 0 means default | |
3408 # (i.e., inherit from parent solution), 1 means false, and | |
3409 # 2 means true. | |
3410 'LinkIncremental': '1', | |
3411 # This corresponds to the /PROFILE flag which ensures the PDB | |
3412 # file contains FIXUP information (growing the PDB file by about | |
3413 # 5%) but does not otherwise alter the output binary. This | |
3414 # information is used by the Syzygy optimization tool when | |
3415 # decomposing the release image. | |
3416 'Profile': 'true', | |
3417 }, | |
3418 }, | |
3419 'conditions': [ | |
3420 ['release_valgrind_build==0 and tsan==0', { | |
3421 'defines': [ | |
3422 'NVALGRIND', | |
3423 'DYNAMIC_ANNOTATIONS_ENABLED=0', | |
3424 ], | |
3425 }, { | |
3426 'defines': [ | |
3427 'MEMORY_TOOL_REPLACES_ALLOCATOR', | |
3428 'MEMORY_SANITIZER_INITIAL_SIZE', | |
3429 'DYNAMIC_ANNOTATIONS_ENABLED=1', | |
3430 'WTF_USE_DYNAMIC_ANNOTATIONS=1', | |
3431 ], | |
3432 }], | |
3433 ['OS=="win" and win_use_allocator_shim==1', { | |
3434 'defines': [ | |
3435 'ALLOCATOR_SHIM' | |
3436 ], | |
3437 }], | |
3438 # _FORTIFY_SOURCE isn't really supported by Clang now, see | |
3439 # http://llvm.org/bugs/show_bug.cgi?id=16821. | |
3440 # It seems to work fine with Ubuntu 12 headers though, so use it | |
3441 # in official builds. | |
3442 ['os_posix==1 and (asan!=1 and msan!=1 and tsan!=1 and lsan!=1 and ubs
an!=1) and (OS!="linux" or clang!=1 or buildtype=="Official")', { | |
3443 'target_conditions': [ | |
3444 ['chromium_code==1', { | |
3445 # Non-chromium code is not guaranteed to compile cleanly | |
3446 # with _FORTIFY_SOURCE. Also, fortified build may fail | |
3447 # when optimizations are disabled, so only do that for Release | |
3448 # build. | |
3449 'defines': [ | |
3450 '_FORTIFY_SOURCE=2', | |
3451 ], | |
3452 }], | |
3453 ], | |
3454 }], | |
3455 ['OS=="linux" or OS=="android"', { | |
3456 'target_conditions': [ | |
3457 ['_toolset=="target"', { | |
3458 'cflags': [ | |
3459 '<@(release_extra_cflags)', | |
3460 ], | |
3461 'conditions': [ | |
3462 ['enable_resource_whitelist_generation==1', { | |
3463 'cflags': [ | |
3464 '-Wunknown-pragmas -Wno-error=unknown-pragmas', | |
3465 ], | |
3466 }], | |
3467 ], | |
3468 }], | |
3469 ], | |
3470 }], | |
3471 ['OS=="ios"', { | |
3472 'defines': [ | |
3473 'NS_BLOCK_ASSERTIONS=1', | |
3474 ], | |
3475 }], | |
3476 ], | |
3477 }, | |
3478 # | |
3479 # Concrete configurations | |
3480 # | |
3481 'Debug': { | |
3482 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'], | |
3483 }, | |
3484 'Release': { | |
3485 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'], | |
3486 }, | |
3487 'conditions': [ | |
3488 [ 'OS=="ios"', { | |
3489 'Profile': { | |
3490 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'], | |
3491 'target_conditions': [ | |
3492 [ '_type=="executable"', { | |
3493 # To get a real .dSYM bundle produced by dsymutil, set the | |
3494 # debug information format to dwarf-with-dsym. Since | |
3495 # strip_from_xcode will not be used, set Xcode to do the | |
3496 # stripping as well. | |
3497 'xcode_settings': { | |
3498 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym', | |
3499 'DEPLOYMENT_POSTPROCESSING': 'YES', | |
3500 'STRIP_INSTALLED_PRODUCT': 'YES', | |
3501 }, | |
3502 }], | |
3503 ], | |
3504 }, | |
3505 }], | |
3506 [ 'OS=="win"', { | |
3507 # TODO(bradnelson): add a gyp mechanism to make this more graceful. | |
3508 'Debug_x64': { | |
3509 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'], | |
3510 }, | |
3511 'Release_x64': { | |
3512 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'], | |
3513 }, | |
3514 }], | |
3515 ], | |
3516 }, | 13 }, |
3517 }, | 14 }, |
3518 'conditions': [ | |
3519 ['os_posix==1', { | |
3520 'target_defaults': { | |
3521 'ldflags': [ | |
3522 '-Wl,-z,now', | |
3523 '-Wl,-z,relro', | |
3524 ], | |
3525 # TODO(glider): enable the default options on other systems. | |
3526 'conditions': [ | |
3527 ['use_sanitizer_options==1 and ((OS=="linux" and (chromeos==0 or targe
t_arch!="ia32")) or OS=="mac")', { | |
3528 'dependencies': [ | |
3529 '<(DEPTH)/build/sanitizers/sanitizers.gyp:sanitizer_options', | |
3530 ], | |
3531 }], | |
3532 ], | |
3533 }, | |
3534 }], | |
3535 # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580 | |
3536 ['os_posix==1 and disable_fatal_linker_warnings==0 and use_evdev_gestures==0
and (chromeos==0 or target_arch!="arm")', { | |
3537 'target_defaults': { | |
3538 'ldflags': [ | |
3539 '-Wl,--fatal-warnings', | |
3540 ], | |
3541 }, | |
3542 }], | |
3543 # -Wl,-z,-defs doesn't work with the sanitiziers, http://crbug.com/452065 | |
3544 ['(OS=="linux" or OS=="android") and asan==0 and msan==0 and tsan==0 and ubs
an==0 and ubsan_security==0 and ubsan_vptr==0 and cfi_diag==0', { | |
3545 'target_defaults': { | |
3546 'ldflags': [ | |
3547 '-Wl,-z,defs', | |
3548 ], | |
3549 }, | |
3550 }], | |
3551 ['os_posix==1 and chromeos==0', { | |
3552 # Chrome OS enables -fstack-protector-strong via its build wrapper, | |
3553 # and we want to avoid overriding this, so stack-protector is only | |
3554 # enabled when not building on Chrome OS. | |
3555 # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc | |
3556 # supports it. See also https://crbug.com/533294 | |
3557 'target_defaults': { | |
3558 'cflags': [ | |
3559 '-fstack-protector', | |
3560 '--param=ssp-buffer-size=4', | |
3561 ], | |
3562 }, | |
3563 }], | |
3564 ['os_posix==1 and OS=="linux"', { | |
3565 'defines': [ | |
3566 '_LARGEFILE_SOURCE', | |
3567 '_LARGEFILE64_SOURCE', | |
3568 '_FILE_OFFSET_BITS=64', | |
3569 ], | |
3570 }], | |
3571 ['os_posix==1 and OS!="mac" and OS!="ios"', { | |
3572 'target_defaults': { | |
3573 # Enable -Werror by default, but put it in a variable so it can | |
3574 # be disabled in ~/.gyp/include.gypi on the valgrind builders. | |
3575 'variables': { | |
3576 'werror%': '-Werror', | |
3577 'libraries_for_target%': '', | |
3578 'conditions' : [ | |
3579 # Enable -Wextra for chromium_code when we control the compiler. | |
3580 ['clang==1', { 'wextra': '-Wextra' }, { 'wextra': '-Wno-extra' }], | |
3581 ], | |
3582 }, | |
3583 'defines': [ | |
3584 '_FILE_OFFSET_BITS=64', | |
3585 ], | |
3586 'cflags': [ | |
3587 '<(werror)', # See note above about the werror variable. | |
3588 '-pthread', | |
3589 '-fno-strict-aliasing', # See http://crbug.com/32204 | |
3590 '-Wall', | |
3591 '<(wextra)', | |
3592 # Don't warn about unused function params. We use those everywhere. | |
3593 '-Wno-unused-parameter', | |
3594 # Don't warn about the "struct foo f = {0};" initialization pattern. | |
3595 '-Wno-missing-field-initializers', | |
3596 # Don't export any symbols (for example, to plugins we dlopen()). | |
3597 # Note: this is *required* to make some plugins work. | |
3598 '-fvisibility=hidden', | |
3599 '-pipe', | |
3600 ], | |
3601 'cflags_cc': [ | |
3602 '-fno-exceptions', | |
3603 '-fno-rtti', | |
3604 # If this is removed then remove the corresponding /Zc:threadSafeInit- | |
3605 # for Windows. | |
3606 '-fno-threadsafe-statics', | |
3607 # Make inline functions have hidden visiblity by default. | |
3608 # Surprisingly, not covered by -fvisibility=hidden. | |
3609 '-fvisibility-inlines-hidden', | |
3610 ], | |
3611 'ldflags': [ | |
3612 '-pthread', '-Wl,-z,noexecstack', | |
3613 ], | |
3614 'libraries' : [ | |
3615 '<(libraries_for_target)', | |
3616 ], | |
3617 'configurations': { | |
3618 'Debug_Base': { | |
3619 'variables': { | |
3620 'debug_optimize%': '0', | |
3621 }, | |
3622 'defines': [ | |
3623 '_DEBUG', | |
3624 ], | |
3625 'cflags': [ | |
3626 '-O>(debug_optimize)', | |
3627 '-g', | |
3628 ], | |
3629 'conditions' : [ | |
3630 ['OS=="android" and target_arch!="mipsel" and target_arch!="mips64
el"', { | |
3631 # TODO(jdduke) Re-enable on mips after resolving linking | |
3632 # issues with libc++ (crbug.com/456380). | |
3633 'ldflags': [ | |
3634 # Warn in case of text relocations. | |
3635 '-Wl,--warn-shared-textrel', | |
3636 ], | |
3637 }], | |
3638 ['OS=="android" and android_full_debug==0', { | |
3639 # Some configurations are copied from Release_Base to reduce | |
3640 # the binary size. | |
3641 'variables': { | |
3642 'debug_optimize%': 's', | |
3643 }, | |
3644 'cflags': [ | |
3645 '-fdata-sections', | |
3646 '-ffunction-sections', | |
3647 ], | |
3648 'ldflags': [ | |
3649 '-Wl,-O1', | |
3650 '-Wl,--as-needed', | |
3651 ], | |
3652 }], | |
3653 ['OS=="android" and android_full_debug==0 and target_arch!="arm64"
', { | |
3654 # We don't omit frame pointers on arm64 since they are required | |
3655 # to correctly unwind stackframes which contain system library | |
3656 # function frames (crbug.com/391706). | |
3657 'cflags': [ | |
3658 '-fomit-frame-pointer', | |
3659 ], | |
3660 }], | |
3661 ['OS=="linux" and target_arch=="ia32"', { | |
3662 'ldflags': [ | |
3663 '-Wl,--no-as-needed', | |
3664 ], | |
3665 }], | |
3666 ['debug_unwind_tables==1', { | |
3667 'cflags': ['-funwind-tables'], | |
3668 }, { | |
3669 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-table
s'], | |
3670 'defines': ['NO_UNWIND_TABLES'], | |
3671 }], | |
3672 ['linux_use_debug_fission==1 and linux_use_gold_flags==1 and binut
ils_version>=223', { | |
3673 'cflags': ['-gsplit-dwarf'], | |
3674 }], | |
3675 ], | |
3676 }, | |
3677 'Release_Base': { | |
3678 'variables': { | |
3679 'release_optimize%': '2', | |
3680 # Binaries become big and gold is unable to perform GC | |
3681 # and remove unused sections for some of test targets | |
3682 # on 32 bit platform. | |
3683 # (This is currently observed only in chromeos valgrind bots) | |
3684 # The following flag is to disable --gc-sections linker | |
3685 # option for these bots. | |
3686 'no_gc_sections%': 0, | |
3687 | |
3688 # TODO(bradnelson): reexamine how this is done if we change the | |
3689 # expansion of configurations | |
3690 'release_valgrind_build%': 0, | |
3691 }, | |
3692 'cflags': [ | |
3693 '-O<(release_optimize)', | |
3694 # Don't emit the GCC version ident directives, they just end up | |
3695 # in the .comment section taking up binary size. | |
3696 '-fno-ident', | |
3697 # Put data and code in their own sections, so that unused symbols | |
3698 # can be removed at link time with --gc-sections. | |
3699 '-fdata-sections', | |
3700 '-ffunction-sections', | |
3701 ], | |
3702 'ldflags': [ | |
3703 # Specifically tell the linker to perform optimizations. | |
3704 # See http://lwn.net/Articles/192624/ . | |
3705 '-Wl,-O1', | |
3706 '-Wl,--as-needed', | |
3707 ], | |
3708 'conditions' : [ | |
3709 ['no_gc_sections==0', { | |
3710 'ldflags': [ | |
3711 '-Wl,--gc-sections', | |
3712 ], | |
3713 }], | |
3714 ['OS=="android" and target_arch!="arm64"', { | |
3715 # We don't omit frame pointers on arm64 since they are required | |
3716 # to correctly unwind stackframes which contain system library | |
3717 # function frames (crbug.com/391706). | |
3718 'cflags': [ | |
3719 '-fomit-frame-pointer', | |
3720 ] | |
3721 }], | |
3722 ['OS=="android" and target_arch!="mipsel" and target_arch!="mips64
el"', { | |
3723 # TODO(jdduke) Re-enable on mips after resolving linking | |
3724 # issues with libc++ (crbug.com/456380). | |
3725 'ldflags': [ | |
3726 # Warn in case of text relocations. | |
3727 '-Wl,--warn-shared-textrel', | |
3728 ], | |
3729 }], | |
3730 ['OS=="android"', { | |
3731 'variables': { | |
3732 'release_optimize%': 's', | |
3733 }, | |
3734 }, { | |
3735 'ldflags': [ | |
3736 # TODO(pcc): Fix linker bug which requires us to link pthread | |
3737 # unconditionally here (crbug.com/623236). | |
3738 '-Wl,--no-as-needed', | |
3739 '-lpthread', | |
3740 '-Wl,--as-needed', | |
3741 ], | |
3742 }], | |
3743 ['profiling==1', { | |
3744 'cflags': [ | |
3745 '-fno-omit-frame-pointer', | |
3746 '-g', | |
3747 ], | |
3748 'conditions' : [ | |
3749 ['profiling_full_stack_frames==1', { | |
3750 'cflags': [ | |
3751 '-fno-inline', | |
3752 '-fno-optimize-sibling-calls', | |
3753 ], | |
3754 }], | |
3755 ], | |
3756 }], | |
3757 ['release_unwind_tables==1', { | |
3758 'cflags': ['-funwind-tables'], | |
3759 }, { | |
3760 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-table
s'], | |
3761 'defines': ['NO_UNWIND_TABLES'], | |
3762 }], | |
3763 ], | |
3764 }, | |
3765 }, | |
3766 'conditions': [ | |
3767 ['target_arch=="ia32"', { | |
3768 'target_conditions': [ | |
3769 ['_toolset=="target"', { | |
3770 'asflags': [ | |
3771 # Needed so that libs with .s files (e.g. libicudata.a) | |
3772 # are compatible with the general 32-bit-ness. | |
3773 '-32', | |
3774 ], | |
3775 # All floating-point computations on x87 happens in 80-bit | |
3776 # precision. Because the C and C++ language standards allow | |
3777 # the compiler to keep the floating-point values in higher | |
3778 # precision than what's specified in the source and doing so | |
3779 # is more efficient than constantly rounding up to 64-bit or | |
3780 # 32-bit precision as specified in the source, the compiler, | |
3781 # especially in the optimized mode, tries very hard to keep | |
3782 # values in x87 floating-point stack (in 80-bit precision) | |
3783 # as long as possible. This has important side effects, that | |
3784 # the real value used in computation may change depending on | |
3785 # how the compiler did the optimization - that is, the value | |
3786 # kept in 80-bit is different than the value rounded down to | |
3787 # 64-bit or 32-bit. There are possible compiler options to | |
3788 # make this behavior consistent (e.g. -ffloat-store would keep | |
3789 # all floating-values in the memory, thus force them to be | |
3790 # rounded to its original precision) but they have significant | |
3791 # runtime performance penalty. | |
3792 # | |
3793 # -mfpmath=sse -msse2 makes the compiler use SSE instructions | |
3794 # which keep floating-point values in SSE registers in its | |
3795 # native precision (32-bit for single precision, and 64-bit | |
3796 # for double precision values). This means the floating-point | |
3797 # value used during computation does not change depending on | |
3798 # how the compiler optimized the code, since the value is | |
3799 # always kept in its specified precision. | |
3800 # | |
3801 # Refer to http://crbug.com/348761 for rationale behind SSE2 | |
3802 # being a minimum requirement for 32-bit Linux builds and | |
3803 # http://crbug.com/313032 for an example where this has "bit" | |
3804 # us in the past. | |
3805 'cflags': [ | |
3806 '-msse2', | |
3807 '-mfpmath=sse', | |
3808 '-mmmx', # Allows mmintrin.h for MMX intrinsics. | |
3809 '-m32', | |
3810 ], | |
3811 'ldflags': [ | |
3812 '-m32', | |
3813 ], | |
3814 'conditions': [ | |
3815 # Use gold linker for Android ia32 target. | |
3816 ['OS=="android"', { | |
3817 # Use gold linker for Android ia32 target. | |
3818 'ldflags': [ | |
3819 '-fuse-ld=gold', | |
3820 ], | |
3821 # Use -mstackrealign due to a bug on ia32 Jelly Bean. | |
3822 # See crbug.com/521527 | |
3823 'cflags': [ | |
3824 '-mstackrealign', | |
3825 ], | |
3826 }], | |
3827 ], | |
3828 }], | |
3829 ], | |
3830 }], | |
3831 ['target_arch=="x64"', { | |
3832 'target_conditions': [ | |
3833 ['_toolset=="target"', { | |
3834 'conditions': [ | |
3835 # Use gold linker for Android x64 target. | |
3836 ['OS=="android"', { | |
3837 'ldflags': [ | |
3838 '-fuse-ld=gold', | |
3839 ], | |
3840 }], | |
3841 ], | |
3842 'cflags': [ | |
3843 '-m64', | |
3844 '-march=x86-64', | |
3845 ], | |
3846 'ldflags': [ | |
3847 '-m64', | |
3848 ], | |
3849 }], | |
3850 ], | |
3851 }], | |
3852 ['target_arch=="arm"', { | |
3853 'target_conditions': [ | |
3854 ['_toolset=="target"', { | |
3855 'conditions': [ | |
3856 ['clang==0', { | |
3857 'cflags': [ | |
3858 # Don't warn about "maybe" uninitialized. Clang doesn't | |
3859 # include this in -Wall but gcc does, and it gives false | |
3860 # positives. | |
3861 '-Wno-maybe-uninitialized', | |
3862 ], | |
3863 'cflags_cc': [ | |
3864 # The codesourcery arm-2009q3 toolchain warns at that the
ABI | |
3865 # has changed whenever it encounters a varargs function. T
his | |
3866 # silences those warnings, as they are not helpful and | |
3867 # clutter legitimate warnings. | |
3868 '-Wno-abi', | |
3869 ], | |
3870 }], | |
3871 ['clang==1 and arm_arch!="" and OS!="android"', { | |
3872 'cflags': [ | |
3873 '-target arm-linux-gnueabihf', | |
3874 ], | |
3875 'ldflags': [ | |
3876 '-target arm-linux-gnueabihf', | |
3877 ], | |
3878 }], | |
3879 ['arm_arch!=""', { | |
3880 'cflags': [ | |
3881 '-march=<(arm_arch)', | |
3882 ], | |
3883 'conditions': [ | |
3884 ['use_lto==1 or use_lto_o2==1', { | |
3885 'ldflags': [ | |
3886 '-march=<(arm_arch)', | |
3887 ], | |
3888 }], | |
3889 ], | |
3890 }], | |
3891 ['arm_tune!=""', { | |
3892 'cflags': [ | |
3893 '-mtune=<(arm_tune)', | |
3894 ], | |
3895 'conditions': [ | |
3896 ['use_lto==1 or use_lto_o2==1', { | |
3897 'ldflags': [ | |
3898 '-mtune=<(arm_tune)', | |
3899 ], | |
3900 }], | |
3901 ], | |
3902 }], | |
3903 ['arm_fpu!=""', { | |
3904 'cflags': [ | |
3905 '-mfpu=<(arm_fpu)', | |
3906 ], | |
3907 'conditions': [ | |
3908 ['use_lto==1 or use_lto_o2==1', { | |
3909 'ldflags': [ | |
3910 '-mfpu=<(arm_fpu)', | |
3911 ], | |
3912 }], | |
3913 ], | |
3914 }], | |
3915 ['arm_float_abi!=""', { | |
3916 'cflags': [ | |
3917 '-mfloat-abi=<(arm_float_abi)', | |
3918 ], | |
3919 'conditions': [ | |
3920 ['use_lto==1 or use_lto_o2==1', { | |
3921 'ldflags': [ | |
3922 '-mfloat-abi=<(arm_float_abi)', | |
3923 ], | |
3924 }], | |
3925 ], | |
3926 }], | |
3927 ['arm_thumb==1', { | |
3928 'cflags': [ | |
3929 '-mthumb', | |
3930 ], | |
3931 'conditions': [ | |
3932 ['use_lto==1 or use_lto_o2==1', { | |
3933 'ldflags': [ | |
3934 '-mthumb', | |
3935 ], | |
3936 }], | |
3937 ], | |
3938 }], | |
3939 ['OS=="android"', { | |
3940 # Most of the following flags are derived from what Android | |
3941 # uses by default when building for arm, reference for which | |
3942 # can be found in the following file in the Android NDK: | |
3943 # toolchains/arm-linux-androideabi-4.9/setup.mk | |
3944 'cflags': [ | |
3945 # The tree-sra optimization (scalar replacement for | |
3946 # aggregates enabling subsequent optimizations) leads to | |
3947 # invalid code generation when using the Android NDK's | |
3948 # compiler (r5-r7). This can be verified using | |
3949 # webkit_unit_tests' WTF.Checked_int8_t test. | |
3950 '-fno-tree-sra', | |
3951 # The following option is disabled to improve binary | |
3952 # size and performance in gcc 4.9. | |
3953 '-fno-caller-saves', | |
3954 '-Wno-psabi', | |
3955 ], | |
3956 # Android now supports .relro sections properly. | |
3957 # NOTE: While these flags enable the generation of .relro | |
3958 # sections, the generated libraries can still be loaded on | |
3959 # older Android platform versions. | |
3960 'ldflags': [ | |
3961 '-Wl,-z,relro', | |
3962 '-Wl,-z,now', | |
3963 '-fuse-ld=gold', | |
3964 ], | |
3965 'conditions': [ | |
3966 ['arm_thumb==1', { | |
3967 'cflags': [ '-mthumb-interwork' ], | |
3968 }], | |
3969 ['profiling==1', { | |
3970 'cflags': [ | |
3971 # Thumb code with frame pointer makes chrome crash | |
3972 # early. | |
3973 '-marm', | |
3974 '-mapcs-frame', # Required by -fno-omit-frame-pointer. | |
3975 # The perf report sometimes incorrectly attributes | |
3976 # code from tail calls. | |
3977 '-fno-optimize-sibling-calls', | |
3978 ], | |
3979 'cflags!': [ | |
3980 '-fomit-frame-pointer', | |
3981 ], | |
3982 }], | |
3983 ['clang==1', { | |
3984 'cflags!': [ | |
3985 # Clang does not support the following options. | |
3986 '-mapcs-frame', | |
3987 '-mthumb-interwork', | |
3988 '-finline-limit=64', | |
3989 '-fno-tree-sra', | |
3990 '-fno-caller-saves', | |
3991 '-Wno-psabi', | |
3992 ], | |
3993 }], | |
3994 ['clang==1 and linux_use_bundled_gold==0', { | |
3995 'ldflags': [ | |
3996 # Let clang find the ld.gold in the NDK. | |
3997 '--gcc-toolchain=<(android_toolchain)/..', | |
3998 ], | |
3999 }], | |
4000 ['asan==1', { | |
4001 'cflags': [ | |
4002 '-marm', # Required for frame pointer based stack trac
es. | |
4003 ], | |
4004 }], | |
4005 ], | |
4006 }], | |
4007 ['chromecast==1', { | |
4008 'cflags': [ | |
4009 # We set arm_arch to "" so that -march compiler option | |
4010 # is not set. Otherwise a gcc bug that would complain | |
4011 # about it conflicting with '-mcpu=cortex-a9'. The flag | |
4012 # '-march=armv7-a' is actually redundant anyway because | |
4013 # it is enabled by default when we built the toolchain. | |
4014 # And using '-mcpu=cortex-a9' should be sufficient. | |
4015 '-mcpu=cortex-a9', | |
4016 '-funwind-tables', | |
4017 # Breakpad requires symbols with debugging information | |
4018 '-g', | |
4019 ], | |
4020 'ldflags': [ | |
4021 # We want to statically link libstdc++/libgcc. | |
4022 '-static-libstdc++', | |
4023 '-static-libgcc', | |
4024 # Don't allow visible symbols from libraries that contain | |
4025 # assembly code with symbols that aren't hidden properly. | |
4026 # http://b/26390825 | |
4027 '-Wl,--exclude-libs=libffmpeg.a', | |
4028 ], | |
4029 'cflags!': [ | |
4030 # Some components in Chromium (e.g. v8, skia, ffmpeg) | |
4031 # define their own cflags for arm builds that could | |
4032 # conflict with the flags we set here (e.g. | |
4033 # '-mcpu=cortex-a9'). Remove these flags explicitly. | |
4034 '-march=armv7-a', | |
4035 '-mtune=cortex-a8', | |
4036 ], | |
4037 'target_conditions': [ | |
4038 [ '_type=="executable" and OS!="android"', { | |
4039 # Statically link whole libstdc++ and libgcc in | |
4040 # executables to ensure only one copy at runtime. | |
4041 'ldflags': [ | |
4042 # Note executables also get -static-stdlibc++/libgcc. | |
4043 # Despite including libstdc++/libgcc archives, we | |
4044 # still need to specify static linking for them in | |
4045 # order to prevent the executable from having a | |
4046 # dynamic dependency on them. | |
4047 | |
4048 # Export stdlibc++ and libgcc symbols to force shlibs | |
4049 # to refer to these symbols from the executable. | |
4050 '-Wl,--export-dynamic', | |
4051 | |
4052 '-lm', # stdlibc++ requires math.h | |
4053 | |
4054 # In case we redefined stdlibc++ symbols | |
4055 # (e.g. tc_malloc) | |
4056 '-Wl,--allow-multiple-definition', | |
4057 | |
4058 '-Wl,--whole-archive', | |
4059 '-l:libstdc++.a', | |
4060 '-l:libgcc.a', | |
4061 '-Wl,--no-whole-archive', | |
4062 ], | |
4063 }] | |
4064 ], | |
4065 }], | |
4066 ], | |
4067 }], | |
4068 ], | |
4069 }], | |
4070 ['target_arch=="arm64"', { | |
4071 'target_conditions': [ | |
4072 ['_toolset=="target"', { | |
4073 'conditions': [ | |
4074 ['OS=="android"', { | |
4075 'cflags!': [ | |
4076 '-fstack-protector', # stack protector is always enabled
on arm64. | |
4077 ], | |
4078 }], | |
4079 ['clang==1 and arm_arch!="" and OS!="android"', { | |
4080 'cflags': [ | |
4081 '-target aarch64-linux-gnu', | |
4082 ], | |
4083 'ldflags': [ | |
4084 '-target aarch64-linux-gnu', | |
4085 ], | |
4086 }], | |
4087 ], | |
4088 }], | |
4089 ], | |
4090 }], | |
4091 ['target_arch=="mipsel"', { | |
4092 'target_conditions': [ | |
4093 ['_toolset=="target"', { | |
4094 'conditions': [ | |
4095 ['mips_arch_variant=="r6"', { | |
4096 'conditions': [ | |
4097 ['clang==1', { | |
4098 'conditions': [ | |
4099 ['OS=="android"', { | |
4100 'cflags': [ '-target mipsel-linux-android', '-march=
mipsel', '-mcpu=mips32r6', ], | |
4101 'ldflags': [ '-target mipsel-linux-android', ], | |
4102 }], | |
4103 ], | |
4104 }, { # clang==0 | |
4105 'cflags': ['-mips32r6', '-Wa,-mips32r6', ], | |
4106 }], | |
4107 ['clang==0 and OS=="android"', { | |
4108 'ldflags': ['-mips32r6', '-Wl,-melf32ltsmip',], | |
4109 }], | |
4110 ['mips_msa==1', { | |
4111 'cflags': ['-mmsa', '-mfp64', '-msched-weight', '-mload-
store-pairs'], | |
4112 }], | |
4113 ], | |
4114 'cflags': [ '-mfp64', '-mno-odd-spreg' ], | |
4115 'ldflags': [ '-mfp64', '-mno-odd-spreg' ], | |
4116 }], | |
4117 ['mips_arch_variant=="r2"', { | |
4118 'conditions': [ | |
4119 ['mips_float_abi=="hard" and mips_fpu_mode!=""', { | |
4120 'cflags': ['-m<(mips_fpu_mode)'], | |
4121 }], | |
4122 ['clang==1', { | |
4123 'conditions': [ | |
4124 ['OS=="android"', { | |
4125 'cflags': [ '-target mipsel-linux-android', '-march=
mipsel', '-mcpu=mips32r2'], | |
4126 'ldflags': [ '-target mipsel-linux-android', ], | |
4127 }, { | |
4128 'cflags': [ '-target mipsel-linux-gnu', '-march=mips
el', '-mcpu=mips32r2'], | |
4129 'ldflags': [ '-target mipsel-linux-gnu', ], | |
4130 }], | |
4131 ], | |
4132 }, { # clang==0 | |
4133 'cflags': ['-mips32r2', '-Wa,-mips32r2', ], | |
4134 }], | |
4135 ], | |
4136 }], | |
4137 ['mips_arch_variant=="r1"', { | |
4138 'conditions': [ | |
4139 ['clang==1', { | |
4140 'conditions': [ | |
4141 ['OS=="android"', { | |
4142 'cflags': [ '-target mipsel-linux-android', '-march=
mipsel', '-mcpu=mips32'], | |
4143 'ldflags': [ '-target mipsel-linux-android', ], | |
4144 }, { | |
4145 'cflags': [ '-target mipsel-linux-gnu', '-march=mips
el', '-mcpu=mips32'], | |
4146 'ldflags': [ '-target mipsel-linux-gnu', ], | |
4147 }], | |
4148 ], | |
4149 }, { # clang==0 | |
4150 'cflags': ['-mips32', '-Wa,-mips32', ], | |
4151 }], | |
4152 ], | |
4153 }], | |
4154 ['clang==1', { | |
4155 'cflags!': [ | |
4156 # Clang does not support the following options. | |
4157 '-finline-limit=64', | |
4158 ], | |
4159 # TODO(gordanac) Enable integrated-as. | |
4160 'cflags': [ '-fno-integrated-as' ], | |
4161 'conditions': [ | |
4162 ['OS=="android"', { | |
4163 'cflags': [ | |
4164 # Else /usr/bin/as gets picked up. | |
4165 '-B<(android_toolchain)', | |
4166 ], | |
4167 }], | |
4168 ], | |
4169 }], | |
4170 ['clang==1 and OS=="android"', { | |
4171 'ldflags': [ | |
4172 # Let clang find the ld in the NDK. | |
4173 '--gcc-toolchain=<(android_toolchain)/..', | |
4174 ], | |
4175 }], | |
4176 ['mips_dsp_rev==1', { | |
4177 'cflags': ['-mdsp'], | |
4178 }], | |
4179 ['mips_dsp_rev==2', { | |
4180 'cflags': ['-mdspr2'], | |
4181 }], | |
4182 ], | |
4183 'cflags': [ | |
4184 '-m<(mips_float_abi)-float' | |
4185 ], | |
4186 'ldflags': [ | |
4187 '-Wl,--no-keep-memory' | |
4188 ], | |
4189 'cflags_cc': [ | |
4190 '-Wno-uninitialized', | |
4191 ], | |
4192 }], | |
4193 ['_toolset=="target" and _type=="executable"', { | |
4194 'conditions': [ | |
4195 ['OS=="linux"', { | |
4196 'ldflags': ['-pie'], | |
4197 }], | |
4198 ], | |
4199 }], | |
4200 ], | |
4201 }], | |
4202 ['target_arch=="mips64el"', { | |
4203 'target_conditions': [ | |
4204 ['_toolset=="target"', { | |
4205 'conditions': [ | |
4206 ['mips_arch_variant=="r6"', { | |
4207 'conditions': [ | |
4208 ['clang==1', { | |
4209 'conditions': [ | |
4210 ['OS=="android"', { | |
4211 'cflags': [ '-target mips64el-linux-android', '-marc
h=mips64el', '-mcpu=mips64r6', ], | |
4212 'ldflags': [ '-target mips64el-linux-android', ], | |
4213 }], | |
4214 ], | |
4215 }, { # clang==0 | |
4216 'cflags': ['-mips64r6', '-Wa,-mips64r6'], | |
4217 'ldflags': ['-mips64r6'], | |
4218 }], | |
4219 ['mips_msa==1', { | |
4220 'cflags': ['-mmsa', '-mfp64', '-msched-weight', '-mload-
store-pairs'], | |
4221 }], | |
4222 ], | |
4223 }], | |
4224 ['mips_arch_variant=="r2"', { | |
4225 'cflags': ['-mips64r2', '-Wa,-mips64r2'], | |
4226 'ldflags': ['-mips64r2'], | |
4227 }], | |
4228 ['clang==1', { | |
4229 'cflags!': [ | |
4230 # Clang does not support the following options. | |
4231 '-finline-limit=64', | |
4232 ], | |
4233 # TODO(gordanac) Enable integrated-as. | |
4234 'cflags': [ '-fno-integrated-as' ], | |
4235 'conditions': [ | |
4236 ['OS=="android"', { | |
4237 'cflags': [ | |
4238 # Else /usr/bin/as gets picked up. | |
4239 '-B<(android_toolchain)', | |
4240 ], | |
4241 }], | |
4242 ], | |
4243 }], | |
4244 ['clang==1 and OS=="android"', { | |
4245 'ldflags': [ | |
4246 # Let clang find the ld in the NDK. | |
4247 '--gcc-toolchain=<(android_toolchain)/..', | |
4248 ], | |
4249 }], | |
4250 ], | |
4251 | |
4252 'cflags_cc': [ | |
4253 '-Wno-uninitialized', | |
4254 ], | |
4255 }], | |
4256 ], | |
4257 }], | |
4258 ['linux_fpic==1', { | |
4259 'cflags': [ | |
4260 '-fPIC', | |
4261 ], | |
4262 'ldflags': [ | |
4263 '-fPIC', | |
4264 ], | |
4265 }], | |
4266 ['sysroot!=""', { | |
4267 'target_conditions': [ | |
4268 ['_toolset=="target"', { | |
4269 'cflags': [ | |
4270 '--sysroot=<(sysroot)', | |
4271 ], | |
4272 'ldflags': [ | |
4273 '--sysroot=<(sysroot)', | |
4274 '<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))', | |
4275 ], | |
4276 }]] | |
4277 }], | |
4278 ['clang==1', { | |
4279 'cflags': [ | |
4280 # See http://crbug.com/110262 | |
4281 '-fcolor-diagnostics', | |
4282 ], | |
4283 'cflags_cc': [ | |
4284 # gnu++11 instead of c++11 is needed because some code uses | |
4285 # typeof() (a GNU extension). | |
4286 # TODO(thakis): Eventually switch this to c++11 instead, | |
4287 # http://crbug.com/427584 | |
4288 '-std=gnu++11', | |
4289 ], | |
4290 }], | |
4291 ['clang==1 and chromeos==1', { | |
4292 'cflags': [ | |
4293 # TODO(thakis): Remove, http://crbug.com/263960 | |
4294 '-Wno-reserved-user-defined-literal', | |
4295 ], | |
4296 }], | |
4297 ['clang==0 and host_clang==1', { | |
4298 'target_conditions': [ | |
4299 ['_toolset=="host"', { | |
4300 'cflags_cc': [ '-std=gnu++11', ], | |
4301 }], | |
4302 ], | |
4303 }], | |
4304 ['clang==1 and clang_use_chrome_plugins==1', { | |
4305 'cflags': [ | |
4306 '<@(clang_chrome_plugins_flags)', | |
4307 ], | |
4308 }], | |
4309 ['clang==1 and clang_load!=""', { | |
4310 'cflags': [ | |
4311 '-Xclang', '-load', '-Xclang', '<(clang_load)', | |
4312 ], | |
4313 }], | |
4314 ['clang==1 and clang_add_plugin!=""', { | |
4315 'cflags': [ | |
4316 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)', | |
4317 ], | |
4318 }], | |
4319 ['clang==1 and target_arch=="ia32"', { | |
4320 'cflags': [ | |
4321 # Else building libyuv gives clang's register allocator issues, | |
4322 # see llvm.org/PR15798 / crbug.com/233709 | |
4323 '-momit-leaf-frame-pointer', | |
4324 # Align the stack on 16-byte boundaries, http://crbug.com/418554. | |
4325 '-mstack-alignment=16', | |
4326 '-mstackrealign', | |
4327 ], | |
4328 }], | |
4329 # Common options for AddressSanitizer, LeakSanitizer, | |
4330 # ThreadSanitizer, MemorySanitizer and non-official CFI builds. | |
4331 ['asan==1 or lsan==1 or tsan==1 or msan==1 or ubsan==1 or ubsan_securi
ty==1 or ubsan_vptr==1 or ' | |
4332 '(cfi_vptr==1 and buildtype!="Official")', { | |
4333 'target_conditions': [ | |
4334 ['_toolset=="target"', { | |
4335 'cflags': [ | |
4336 '-fno-omit-frame-pointer', | |
4337 '-gline-tables-only', | |
4338 ], | |
4339 'cflags!': [ | |
4340 '-fomit-frame-pointer', | |
4341 ], | |
4342 }], | |
4343 ], | |
4344 }], | |
4345 ['asan==1 or lsan==1 or tsan==1 or msan==1', { | |
4346 'target_conditions': [ | |
4347 ['_toolset=="target"', { | |
4348 'ldflags!': [ | |
4349 # Functions interposed by the sanitizers can make ld think | |
4350 # that some libraries aren't needed when they actually are, | |
4351 # http://crbug.com/234010. As workaround, disable --as-needed. | |
4352 '-Wl,--as-needed', | |
4353 ], | |
4354 'defines': [ | |
4355 'MEMORY_TOOL_REPLACES_ALLOCATOR', | |
4356 'MEMORY_SANITIZER_INITIAL_SIZE', | |
4357 ], | |
4358 }], | |
4359 ], | |
4360 }], | |
4361 ['asan==1', { | |
4362 'target_conditions': [ | |
4363 ['_toolset=="target"', { | |
4364 'cflags': [ | |
4365 '-fsanitize=address', | |
4366 # TODO(eugenis): Re-enable. http://crbug.com/427202 | |
4367 #'-fsanitize-blacklist=<(asan_blacklist)', | |
4368 ], | |
4369 'ldflags': [ | |
4370 '-fsanitize=address', | |
4371 ], | |
4372 }], | |
4373 ], | |
4374 'conditions': [ | |
4375 ['OS=="mac"', { | |
4376 'cflags': [ | |
4377 '-mllvm -asan-globals=0', # http://crbug.com/352073 | |
4378 ], | |
4379 }], | |
4380 ], | |
4381 }], | |
4382 ['ubsan==1', { | |
4383 'target_conditions': [ | |
4384 ['_toolset=="target"', { | |
4385 'conditions': [ | |
4386 ['chromecast==0', { | |
4387 'cflags': [ | |
4388 # Employ the experimental PBQP register allocator to avoid | |
4389 # slow compilation on files with too many basic blocks. | |
4390 # See http://crbug.com/426271. | |
4391 '-mllvm -regalloc=pbqp', | |
4392 # Speculatively use coalescing to slightly improve the cod
e | |
4393 # generated by PBQP regallocator. May increase compile tim
e. | |
4394 '-mllvm -pbqp-coalescing', | |
4395 ], | |
4396 }], | |
4397 ], | |
4398 'cflags': [ | |
4399 # FIXME: work on enabling more flags and getting rid of false | |
4400 # positives. http://crbug.com/174801. | |
4401 '-fsanitize=bounds', | |
4402 '-fsanitize=float-divide-by-zero', | |
4403 '-fsanitize=integer-divide-by-zero', | |
4404 '-fsanitize=null', | |
4405 '-fsanitize=object-size', | |
4406 '-fsanitize=return', | |
4407 '-fsanitize=returns-nonnull-attribute', | |
4408 '-fsanitize=shift-exponent', | |
4409 '-fsanitize=signed-integer-overflow', | |
4410 '-fsanitize=unreachable', | |
4411 '-fsanitize=vla-bound', | |
4412 '-fsanitize-blacklist=<(ubsan_blacklist)', | |
4413 ], | |
4414 'cflags_cc!': [ | |
4415 '-fno-rtti', | |
4416 ], | |
4417 'cflags!': [ | |
4418 '-fno-rtti', | |
4419 ], | |
4420 'ldflags': [ | |
4421 '-fsanitize=undefined', | |
4422 ], | |
4423 'defines': [ | |
4424 'UNDEFINED_SANITIZER', | |
4425 ], | |
4426 }], | |
4427 ], | |
4428 }], | |
4429 ['ubsan_security==1', { | |
4430 'target_conditions': [ | |
4431 ['_toolset=="target"', { | |
4432 'cflags': [ | |
4433 '-fsanitize=signed-integer-overflow,shift,vptr', | |
4434 '-fsanitize-blacklist=<(ubsan_security_blacklist)', | |
4435 ], | |
4436 'cflags_cc!': [ | |
4437 '-fno-rtti', | |
4438 ], | |
4439 'cflags!': [ | |
4440 '-fno-rtti', | |
4441 ], | |
4442 'ldflags': [ | |
4443 '-fsanitize=signed-integer-overflow,shift,vptr', | |
4444 ], | |
4445 'defines': [ | |
4446 'UNDEFINED_SANITIZER', | |
4447 ], | |
4448 }], | |
4449 ], | |
4450 }], | |
4451 ['ubsan_vptr==1', { | |
4452 'target_conditions': [ | |
4453 ['_toolset=="target"', { | |
4454 'cflags': [ | |
4455 '-fsanitize=vptr', | |
4456 '-fsanitize-blacklist=<(ubsan_vptr_blacklist)', | |
4457 ], | |
4458 'cflags_cc!': [ | |
4459 '-fno-rtti', | |
4460 ], | |
4461 'cflags!': [ | |
4462 '-fno-rtti', | |
4463 ], | |
4464 'ldflags': [ | |
4465 '-fsanitize=vptr', | |
4466 ], | |
4467 'defines': [ | |
4468 'UNDEFINED_SANITIZER', | |
4469 ], | |
4470 }], | |
4471 ], | |
4472 }], | |
4473 ['sanitizer_coverage!=""', { | |
4474 'target_conditions': [ | |
4475 ['_toolset=="target"', { | |
4476 'cflags': [ | |
4477 '-fsanitize-coverage=<(sanitizer_coverage)', | |
4478 ], | |
4479 'defines': [ | |
4480 'SANITIZER_COVERAGE', | |
4481 ], | |
4482 }], | |
4483 ], | |
4484 }], | |
4485 ['sanitizer_coverage!="" and target_arch=="arm"', { | |
4486 'target_conditions': [ | |
4487 ['_toolset=="target"', { | |
4488 'cflags': [ | |
4489 '-mllvm -sanitizer-coverage-block-threshold=0', # http://crbu
g.com/517105 | |
4490 ], | |
4491 }], | |
4492 ], | |
4493 }], | |
4494 ['asan_field_padding!=0', { | |
4495 'target_conditions': [ | |
4496 ['_toolset=="target"', { | |
4497 'cflags': [ | |
4498 '-fsanitize-address-field-padding=<(asan_field_padding)', | |
4499 ], | |
4500 }], | |
4501 ], | |
4502 }], | |
4503 ['lsan==1', { | |
4504 'target_conditions': [ | |
4505 ['_toolset=="target"', { | |
4506 'cflags': [ | |
4507 '-fsanitize=leak', | |
4508 ], | |
4509 'ldflags': [ | |
4510 '-fsanitize=leak', | |
4511 ], | |
4512 'defines': [ | |
4513 'LEAK_SANITIZER', | |
4514 'WTF_USE_LEAK_SANITIZER=1', | |
4515 ], | |
4516 }], | |
4517 ], | |
4518 }], | |
4519 ['tsan==1', { | |
4520 'target_conditions': [ | |
4521 ['_toolset=="target"', { | |
4522 'cflags': [ | |
4523 '-fsanitize=thread', | |
4524 '-fsanitize-blacklist=<(tsan_blacklist)', | |
4525 ], | |
4526 'ldflags': [ | |
4527 '-fsanitize=thread', | |
4528 ], | |
4529 'defines': [ | |
4530 'THREAD_SANITIZER', | |
4531 'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1', | |
4532 'WTF_USE_DYNAMIC_ANNOTATIONS_NOIMPL=1', | |
4533 ], | |
4534 }], | |
4535 ], | |
4536 }], | |
4537 ['msan==1', { | |
4538 'target_conditions': [ | |
4539 ['_toolset=="target"', { | |
4540 'cflags': [ | |
4541 '-fsanitize=memory', | |
4542 '-fsanitize-memory-track-origins=<(msan_track_origins)', | |
4543 '-fsanitize-blacklist=<(msan_blacklist)', | |
4544 ], | |
4545 'ldflags': [ | |
4546 '-fsanitize=memory', | |
4547 ], | |
4548 'defines': [ | |
4549 'MEMORY_SANITIZER', | |
4550 ], | |
4551 }], | |
4552 ], | |
4553 }], | |
4554 ['use_instrumented_libraries==1', { | |
4555 'dependencies': [ | |
4556 '<(DEPTH)/third_party/instrumented_libraries/instrumented_librarie
s.gyp:instrumented_libraries', | |
4557 ], | |
4558 }], | |
4559 ['use_prebuilt_instrumented_libraries==1', { | |
4560 'dependencies': [ | |
4561 '<(DEPTH)/third_party/instrumented_libraries/instrumented_librarie
s.gyp:prebuilt_instrumented_libraries', | |
4562 ], | |
4563 }], | |
4564 ['use_custom_libcxx==1', { | |
4565 'dependencies': [ | |
4566 '<(DEPTH)/buildtools/third_party/libc++/libc++.gyp:libcxx_proxy', | |
4567 ], | |
4568 }], | |
4569 ['order_profiling!=0 and OS=="android"', { | |
4570 'target_conditions' : [ | |
4571 ['_toolset=="target"', { | |
4572 'cflags': ['-finstrument-functions'], | |
4573 'defines': ['CYGPROFILE_INSTRUMENTATION'], | |
4574 }], | |
4575 ], | |
4576 }], | |
4577 # Clang doesn't understand -finstrument-functions-exclude-file-list=. | |
4578 ['order_profiling!=0 and OS=="android" and clang==0', { | |
4579 'target_conditions' : [ | |
4580 ['_toolset=="target"', { | |
4581 'cflags': [ | |
4582 # Allow mmx intrinsics to inline, so that the | |
4583 # compiler can expand the intrinsics. | |
4584 '-finstrument-functions-exclude-file-list=mmintrin.h', | |
4585 # Avoids errors with current NDK: | |
4586 # "third_party/android_tools/ndk/toolchains/arm-linux-androide
abi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/include/a
rm_neon.h:3426:3: error: argument must be a constant" | |
4587 '-finstrument-functions-exclude-file-list=arm_neon.h', | |
4588 ], | |
4589 }], | |
4590 ], | |
4591 }], | |
4592 ['linux_dump_symbols==1', { | |
4593 'cflags': [ '-g' ], | |
4594 'conditions': [ | |
4595 ['OS=="linux" and host_arch=="ia32" and linux_use_bundled_gold==0'
, { | |
4596 'target_conditions': [ | |
4597 ['_toolset=="target"', { | |
4598 'ldflags': [ | |
4599 # Attempt to use less memory to prevent the linker from | |
4600 # running out of address space. Considering installing a | |
4601 # 64-bit kernel and switching to a 64-bit linker. | |
4602 '-Wl,--no-keep-memory', | |
4603 ], | |
4604 }], | |
4605 ], | |
4606 }], | |
4607 ], | |
4608 }], | |
4609 ['use_allocator!="tcmalloc"', { | |
4610 'defines': ['NO_TCMALLOC'], | |
4611 }], | |
4612 ['linux_use_gold_flags==1', { | |
4613 # Newer gccs and clangs support -fuse-ld, use the flag to force gold | |
4614 # selection. | |
4615 # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Option
s.html | |
4616 'ldflags': [ '-fuse-ld=gold', ], | |
4617 | |
4618 'target_conditions': [ | |
4619 ['_toolset=="target"', { | |
4620 'conditions': [ | |
4621 # TODO(thestig): Enable this for disabled cases. | |
4622 [ 'linux_use_bundled_binutils==1', { | |
4623 'ldflags': [ | |
4624 # Experimentation found that using four linking threads | |
4625 # saved ~20% of link time. | |
4626 # https://groups.google.com/a/chromium.org/group/chromium-
dev/browse_thread/thread/281527606915bb36 | |
4627 # Only apply this to the target linker, since the host | |
4628 # linker might not be gold, but isn't used much anyway. | |
4629 '-Wl,--threads', | |
4630 '-Wl,--thread-count=4', | |
4631 ], | |
4632 }], | |
4633 # TODO(thestig): Enable this for disabled cases. | |
4634 [ 'buildtype!="Official" and chromeos==0 and release_valgrind_
build==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==0 and ubsan_
security==0 and ubsan_vptr==0', { | |
4635 'ldflags': [ | |
4636 '-Wl,--detect-odr-violations', | |
4637 ], | |
4638 }], | |
4639 ], | |
4640 }], | |
4641 ], | |
4642 'conditions': [ | |
4643 ['release_valgrind_build==0 and order_profiling==0 and asan==0 and
msan==0 and lsan==0 and tsan==0', { | |
4644 'target_conditions': [ | |
4645 ['_toolset=="target"', { | |
4646 'ldflags': [ | |
4647 '-Wl,--icf=<(gold_icf_level)', | |
4648 ], | |
4649 }], | |
4650 ], | |
4651 }], | |
4652 ], | |
4653 }], | |
4654 ['linux_use_bundled_binutils==1', { | |
4655 'cflags': [ | |
4656 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)', | |
4657 ], | |
4658 }], | |
4659 ['linux_use_bundled_gold==1 and ' | |
4660 'not (clang==0 and (use_lto==1 or use_lto_o2==1))', { | |
4661 # Put our binutils, which contains gold in the search path. We pass | |
4662 # the path to gold to the compiler. gyp leaves unspecified what the | |
4663 # cwd is when running the compiler, so the normal gyp path-munging | |
4664 # fails us. This hack gets the right path. | |
4665 # | |
4666 # Disabled when using GCC LTO because GCC also uses the -B search | |
4667 # path at link time to find "as", and our bundled "as" can only | |
4668 # target x86. | |
4669 'ldflags': [ | |
4670 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)', | |
4671 ], | |
4672 }], | |
4673 # Some binutils 2.23 releases may or may not have new dtags enabled, | |
4674 # but they are all compatible with --disable-new-dtags, | |
4675 # because the new dynamic tags are not created by default. | |
4676 ['binutils_version>=223', { | |
4677 # Newer binutils don't set DT_RPATH unless you disable "new" dtags | |
4678 # and the new DT_RUNPATH doesn't work without --no-as-needed flag. | |
4679 # FIXME(mithro): Figure out the --as-needed/--no-as-needed flags | |
4680 # inside this file to allow usage of --no-as-needed and removal of | |
4681 # this flag. | |
4682 'ldflags': [ | |
4683 '-Wl,--disable-new-dtags', | |
4684 ], | |
4685 }], | |
4686 ['clang==0', { | |
4687 'target_conditions': [ | |
4688 ['_toolset=="target"', { | |
4689 'cflags_cc': [ | |
4690 '-std=gnu++11', | |
4691 # See comment for -Wno-c++11-narrowing. | |
4692 '-Wno-narrowing', | |
4693 ], | |
4694 }], | |
4695 ], | |
4696 }], | |
4697 ['clang==0 and host_clang==0', { | |
4698 'target_conditions': [ | |
4699 ['_toolset=="host"', { | |
4700 'cflags_cc': [ | |
4701 '-std=gnu++11', | |
4702 # See comment for -Wno-c++11-narrowing. | |
4703 '-Wno-narrowing', | |
4704 ], | |
4705 }], | |
4706 ], | |
4707 }], | |
4708 ['clang==0 and chromeos==1', { | |
4709 'target_conditions': [ | |
4710 ['_toolset=="target"', { | |
4711 'cflags_cc': [ | |
4712 # TODO(thakis): Remove, http://crbug.com/263960 | |
4713 '-Wno-literal-suffix', | |
4714 ], | |
4715 }], | |
4716 ], | |
4717 }], | |
4718 ['clang==0 and host_clang==0 and chromeos==1', { | |
4719 'target_conditions': [ | |
4720 ['_toolset=="host"', { | |
4721 'cflags_cc': [ | |
4722 # TODO(thakis): Remove, http://crbug.com/263960 | |
4723 '-Wno-literal-suffix', | |
4724 ], | |
4725 }], | |
4726 ], | |
4727 }], | |
4728 ], | |
4729 }, | |
4730 }], | |
4731 # *BSD-specific options; note that most *BSD options are set above, | |
4732 # with Linux. | |
4733 ['OS=="openbsd" or OS=="freebsd"', { | |
4734 'target_defaults': { | |
4735 'ldflags': [ | |
4736 '-Wl,--no-keep-memory', | |
4737 ], | |
4738 }, | |
4739 }], | |
4740 # Android-specific options; note that most are set above with Linux. | |
4741 ['OS=="android"', { | |
4742 'variables': { | |
4743 # Placing this variable here prevents from forking libvpx, used | |
4744 # by remoting. Remoting is off, so it needn't built, | |
4745 # so forking it's deps seems like overkill. | |
4746 # But this variable need defined to properly run gyp. | |
4747 # A proper solution is to have an OS==android conditional | |
4748 # in third_party/libvpx/libvpx.gyp to define it. | |
4749 'libvpx_path': 'lib/linux/arm', | |
4750 }, | |
4751 'target_defaults': { | |
4752 'variables': { | |
4753 'release_extra_cflags%': '', | |
4754 'conditions': [ | |
4755 # If we're using the components build, append "cr" to all shared | |
4756 # libraries to avoid naming collisions with android system library | |
4757 # versions with the same name (e.g. skia, icu). | |
4758 ['component=="shared_library"', { | |
4759 'android_product_extension': 'cr.so', | |
4760 }, { | |
4761 'android_product_extension': 'so', | |
4762 } ], | |
4763 ], | |
4764 }, | |
4765 'target_conditions': [ | |
4766 ['_type=="shared_library"', { | |
4767 'product_extension': '<(android_product_extension)', | |
4768 }], | |
4769 | |
4770 # Settings for building device targets using Android's toolchain. | |
4771 # These are based on the setup.mk file from the Android NDK. | |
4772 # | |
4773 # The NDK Android executable link step looks as follows: | |
4774 # $LDFLAGS | |
4775 # $(TARGET_CRTBEGIN_DYNAMIC_O) <-- crtbegin.o | |
4776 # $(PRIVATE_OBJECTS) <-- The .o that we built | |
4777 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built | |
4778 # $(TARGET_LIBGCC) <-- libgcc.a | |
4779 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built | |
4780 # $(PRIVATE_LDLIBS) <-- System .so | |
4781 # $(TARGET_CRTEND_O) <-- crtend.o | |
4782 # | |
4783 # For now the above are approximated for executables by adding | |
4784 # crtbegin.o to the end of the ldflags and 'crtend.o' to the end | |
4785 # of 'libraries'. | |
4786 # | |
4787 # The NDK Android shared library link step looks as follows: | |
4788 # $LDFLAGS | |
4789 # $(PRIVATE_OBJECTS) <-- The .o that we built | |
4790 # -l,--whole-archive | |
4791 # $(PRIVATE_WHOLE_STATIC_LIBRARIES) | |
4792 # -l,--no-whole-archive | |
4793 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built | |
4794 # $(TARGET_LIBGCC) <-- libgcc.a | |
4795 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built | |
4796 # $(PRIVATE_LDLIBS) <-- System .so | |
4797 # | |
4798 # For now, assume that whole static libraries are not needed. | |
4799 # | |
4800 # For both executables and shared libraries, add the proper | |
4801 # libgcc.a to the start of libraries which puts it in the | |
4802 # proper spot after .o and .a files get linked in. | |
4803 # | |
4804 # TODO: The proper thing to do longer-tem would be proper gyp | |
4805 # support for a custom link command line. | |
4806 ['_toolset=="target"', { | |
4807 'cflags!': [ | |
4808 '-pthread', # Not supported by Android toolchain. | |
4809 ], | |
4810 'cflags': [ | |
4811 '-ffunction-sections', | |
4812 '-funwind-tables', | |
4813 '-g', | |
4814 '-fstack-protector', | |
4815 '-fno-short-enums', | |
4816 '-finline-limit=64', | |
4817 '<@(release_extra_cflags)', | |
4818 '--sysroot=<(android_ndk_sysroot)', | |
4819 ], | |
4820 'cflags_cc': [ | |
4821 # NOTE: The libc++ header include paths below are specified in | |
4822 # cflags rather than include_dirs because they need to come | |
4823 # after include_dirs. | |
4824 # The include ordering here is important; change with caution. | |
4825 '-isystem<(android_libcpp_include)', | |
4826 '-isystem<(android_ndk_root)/sources/cxx-stl/llvm-libc++abi/libcxx
abi/include', | |
4827 '-isystem<(android_ndk_root)/sources/android/support/include', | |
4828 ], | |
4829 'defines': [ | |
4830 'ANDROID', | |
4831 '__GNU_SOURCE=1', # Necessary for clone() | |
4832 # The NDK has these things, but doesn't define the constants | |
4833 # to say that it does. Define them here instead. | |
4834 'HAVE_SYS_UIO_H', | |
4835 'ANDROID_NDK_VERSION=<(android_ndk_version)', | |
4836 ], | |
4837 'ldflags!': [ | |
4838 '-pthread', # Not supported by Android toolchain. | |
4839 ], | |
4840 'ldflags': [ | |
4841 '-Wl,--build-id=sha1', | |
4842 '-Wl,--no-undefined', | |
4843 '--sysroot=<(android_ndk_sysroot)', | |
4844 '-nostdlib', | |
4845 '-L<(android_libcpp_libs_dir)', | |
4846 # Don't allow visible symbols from libgcc or libc++ to be | |
4847 # re-exported. | |
4848 '-Wl,--exclude-libs=libgcc.a', | |
4849 '-Wl,--exclude-libs=libc++_static.a', | |
4850 # Don't allow visible symbols from libraries that contain | |
4851 # assembly code with symbols that aren't hidden properly. | |
4852 # http://crbug.com/448386 | |
4853 '-Wl,--exclude-libs=libcommon_audio.a', | |
4854 '-Wl,--exclude-libs=libcommon_audio_neon.a', | |
4855 '-Wl,--exclude-libs=libcommon_audio_sse2.a', | |
4856 '-Wl,--exclude-libs=libiSACFix.a', | |
4857 '-Wl,--exclude-libs=libisac_neon.a', | |
4858 '-Wl,--exclude-libs=libopus.a', | |
4859 '-Wl,--exclude-libs=libvpx.a', | |
4860 ], | |
4861 'libraries': [ | |
4862 '-l<(android_libcpp_library)', | |
4863 '-latomic', | |
4864 # Manually link the libgcc.a that the cross compiler uses. | |
4865 '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)', | |
4866 '-lc', | |
4867 '-ldl', | |
4868 '-lm', | |
4869 ], | |
4870 'conditions': [ | |
4871 ['component=="static_library"', { | |
4872 'target_conditions': [ | |
4873 ['use_native_jni_exports==0', { | |
4874 # Use a linker version script to strip JNI exports from | |
4875 # binaries which have not specifically asked to use them. | |
4876 'ldflags': [ | |
4877 '-Wl,--version-script=<!(cd <(DEPTH) && pwd -P)/build/andr
oid/android_no_jni_exports.lst', | |
4878 ], | |
4879 }], | |
4880 ], | |
4881 }], | |
4882 ['clang==1', { | |
4883 'libraries!': [ | |
4884 # Clang with libc++ does not require an explicit atomic | |
4885 # library reference. | |
4886 '-latomic', | |
4887 ], | |
4888 'cflags': [ | |
4889 # Work around incompatibilities between bionic and clang | |
4890 # headers. | |
4891 '-D__compiler_offsetof=__builtin_offsetof', | |
4892 '-Dnan=__builtin_nan', | |
4893 ], | |
4894 'cflags!': [ | |
4895 # Clang does not support the following options. | |
4896 '-finline-limit=64', | |
4897 ], | |
4898 'conditions': [ | |
4899 ['target_arch=="arm"', { | |
4900 'cflags': [ | |
4901 '-target arm-linux-androideabi', | |
4902 ], | |
4903 'ldflags': [ | |
4904 '-target arm-linux-androideabi', | |
4905 ], | |
4906 }], | |
4907 ['target_arch=="ia32"', { | |
4908 'cflags': [ | |
4909 '-target i686-linux-androideabi', | |
4910 ], | |
4911 'ldflags': [ | |
4912 '-target i686-linux-androideabi', | |
4913 ], | |
4914 }], | |
4915 # Place holder for arm64 support, not tested. | |
4916 # TODO: Enable clang support for Android Arm64. http://crbug.c
om/539781 | |
4917 ['target_arch=="arm64"', { | |
4918 'cflags': [ | |
4919 '-target aarch64-linux-androideabi', | |
4920 ], | |
4921 'ldflags': [ | |
4922 '-target aarch64-linux-androideabi', | |
4923 ], | |
4924 }], | |
4925 # Place holder for x64 support, not tested. | |
4926 # TODO: Enable clang support for Android x64. http://crbug.com
/539781 | |
4927 ['target_arch=="x64"', { | |
4928 'cflags': [ | |
4929 '-target x86_64-linux-androideabi', | |
4930 ], | |
4931 'ldflags': [ | |
4932 '-target x86_64-linux-androideabi', | |
4933 ], | |
4934 }], | |
4935 ], | |
4936 }], | |
4937 ['asan==1', { | |
4938 'cflags': [ | |
4939 # Android build relies on -Wl,--gc-sections removing | |
4940 # unreachable code. ASan instrumentation for globals inhibits | |
4941 # this and results in a library with unresolvable relocations. | |
4942 # TODO(eugenis): find a way to reenable this. | |
4943 '-mllvm -asan-globals=0', | |
4944 ], | |
4945 }], | |
4946 ['target_arch == "arm" and order_profiling==0', { | |
4947 'ldflags': [ | |
4948 # Enable identical code folding to reduce size. | |
4949 '-Wl,--icf=<(gold_icf_level)', | |
4950 ], | |
4951 }], | |
4952 ['target_arch=="ia32"', { | |
4953 # The x86 toolchain currently has problems with stack-protector. | |
4954 'cflags!': [ | |
4955 '-fstack-protector', | |
4956 ], | |
4957 'cflags': [ | |
4958 '-fno-stack-protector', | |
4959 ], | |
4960 }], | |
4961 ], | |
4962 'target_conditions': [ | |
4963 ['_type=="executable"', { | |
4964 'cflags': [ | |
4965 '-fPIE', | |
4966 ], | |
4967 'ldflags': [ | |
4968 '-Bdynamic', | |
4969 '-Wl,--gc-sections', | |
4970 '-Wl,-z,nocopyreloc', | |
4971 '-pie', | |
4972 # crtbegin_dynamic.o should be the last item in ldflags. | |
4973 '<(android_ndk_lib)/crtbegin_dynamic.o', | |
4974 ], | |
4975 'libraries': [ | |
4976 # crtend_android.o needs to be the last item in libraries. | |
4977 # Do not add any libraries after this! | |
4978 '<(android_ndk_lib)/crtend_android.o', | |
4979 ], | |
4980 }], | |
4981 ['_type=="shared_library" or _type=="loadable_module"', { | |
4982 'ldflags': [ | |
4983 '-Wl,-shared,-Bsymbolic', | |
4984 # crtbegin_so.o should be the last item in ldflags. | |
4985 '<(android_ndk_lib)/crtbegin_so.o', | |
4986 ], | |
4987 'libraries': [ | |
4988 # crtend_so.o needs to be the last item in libraries. | |
4989 # Do not add any libraries after this! | |
4990 '<(android_ndk_lib)/crtend_so.o', | |
4991 ], | |
4992 }], | |
4993 ], | |
4994 }], | |
4995 # Settings for building host targets using the system toolchain. | |
4996 ['_toolset=="host"', { | |
4997 'cflags!': [ | |
4998 # Due to issues in Clang build system, using ASan on 32-bit | |
4999 # binaries on x86_64 host is problematic. | |
5000 # TODO(eugenis): re-enable. | |
5001 '-fsanitize=address', | |
5002 ], | |
5003 'ldflags!': [ | |
5004 '-fsanitize=address', | |
5005 '-Wl,-z,noexecstack', | |
5006 '-Wl,--gc-sections', | |
5007 '-Wl,-O1', | |
5008 '-Wl,--as-needed', | |
5009 '-Wl,--warn-shared-textrel', | |
5010 '-Wl,--fatal-warnings', | |
5011 ], | |
5012 }], | |
5013 # Settings for building host targets on mac. | |
5014 ['_toolset=="host" and host_os=="mac"', { | |
5015 'ldflags!': [ | |
5016 '-Wl,-z,now', | |
5017 '-Wl,-z,relro', | |
5018 ], | |
5019 }], | |
5020 ], | |
5021 }, | |
5022 }], | |
5023 ['OS=="solaris"', { | |
5024 'cflags!': ['-fvisibility=hidden'], | |
5025 'cflags_cc!': ['-fvisibility-inlines-hidden'], | |
5026 }], | |
5027 ['OS=="mac" or OS=="ios"', { | |
5028 'target_defaults': { | |
5029 'mac_bundle': 0, | |
5030 'xcode_settings': { | |
5031 'ALWAYS_SEARCH_USER_PATHS': 'NO', | |
5032 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11', # -std=c++11 | |
5033 # Don't link in libarclite_macosx.a, see http://crbug.com/156530. | |
5034 'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime | |
5035 # Warn if automatic synthesis is triggered with | |
5036 # the -Wobjc-missing-property-synthesis flag. | |
5037 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES', | |
5038 'COPY_PHASE_STRIP': 'NO', | |
5039 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99 | |
5040 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks | |
5041 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions | |
5042 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti | |
5043 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings | |
5044 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden | |
5045 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES', | |
5046 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors | |
5047 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden | |
5048 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics | |
5049 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror | |
5050 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0', | |
5051 'USE_HEADERMAP': 'NO', | |
5052 'WARNING_CFLAGS': [ | |
5053 '-Wall', | |
5054 '-Wextra', | |
5055 # Don't warn about unused function parameters. | |
5056 '-Wno-unused-parameter', | |
5057 # Don't warn about the "struct foo f = {0};" initialization | |
5058 # pattern. | |
5059 '-Wno-missing-field-initializers', | |
5060 # This warns on selectors from Cocoa headers (-length, -set). | |
5061 # cfe-dev is currently discussing the merits of this warning. | |
5062 # TODO(thakis): Reevaluate what to do with this, based on the | |
5063 # cfe-dev discussion. | |
5064 '-Wno-selector-type-mismatch', | |
5065 ], | |
5066 'conditions': [ | |
5067 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'}, | |
5068 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'} | |
5069 ], | |
5070 ['clang==1', { | |
5071 'OTHER_CFLAGS': [ | |
5072 # See http://crbug.com/110262 | |
5073 '-fcolor-diagnostics', | |
5074 ], | |
5075 }], | |
5076 # Note that the prebuilt Clang binaries should not be used for iOS | |
5077 # development except for ASan builds. | |
5078 ['clang_xcode==0', { | |
5079 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang', | |
5080 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++', | |
5081 }], | |
5082 ['clang==1 and clang_xcode==0 and clang_use_chrome_plugins==1', { | |
5083 'OTHER_CFLAGS': [ | |
5084 '<@(clang_chrome_plugins_flags)', | |
5085 ], | |
5086 }], | |
5087 ['clang==1 and clang_xcode==0 and clang_load!=""', { | |
5088 'OTHER_CFLAGS': [ | |
5089 '-Xclang', '-load', '-Xclang', '<(clang_load)', | |
5090 ], | |
5091 }], | |
5092 ['clang==1 and clang_xcode==0 and clang_add_plugin!=""', { | |
5093 'OTHER_CFLAGS': [ | |
5094 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)', | |
5095 ], | |
5096 }], | |
5097 ], | |
5098 }, | |
5099 'conditions': [ | |
5100 ['clang==1', { | |
5101 'variables': { | |
5102 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin', | |
5103 }, | |
5104 }], | |
5105 ['asan==1', { | |
5106 'xcode_settings': { | |
5107 'OTHER_CFLAGS': [ | |
5108 '-fsanitize=address', | |
5109 '-mllvm -asan-globals=0', # http://crbug.com/352073 | |
5110 '-gline-tables-only', | |
5111 ], | |
5112 }, | |
5113 }], | |
5114 ['sanitizer_coverage!=""', { | |
5115 'target_conditions': [ | |
5116 ['_toolset=="target"', { | |
5117 'cflags': [ | |
5118 '-fsanitize-coverage=<(sanitizer_coverage)', | |
5119 ], | |
5120 'defines': [ | |
5121 'SANITIZER_COVERAGE', | |
5122 ], | |
5123 }], | |
5124 ], | |
5125 }], | |
5126 ], | |
5127 'target_conditions': [ | |
5128 ['_type!="static_library"', { | |
5129 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']}, | |
5130 'conditions': [ | |
5131 ['asan==1', { | |
5132 'xcode_settings': { | |
5133 'OTHER_LDFLAGS': [ | |
5134 '-fsanitize=address', | |
5135 ], | |
5136 }, | |
5137 }], | |
5138 ['mac_write_linker_maps==1', { | |
5139 'xcode_settings': { | |
5140 'OTHER_LDFLAGS': [ | |
5141 '-Wl,-map,>(_target_name).map', | |
5142 ], | |
5143 }, | |
5144 }], | |
5145 ], | |
5146 }], | |
5147 ['_mac_bundle', { | |
5148 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']}, | |
5149 'target_conditions': [ | |
5150 ['_type=="executable"', { | |
5151 'conditions': [ | |
5152 ['asan==1', { | |
5153 'postbuilds': [ | |
5154 { | |
5155 'variables': { | |
5156 # Define copy_asan_dylib_path in a variable ending in | |
5157 # _path so that gyp understands it's a path and | |
5158 # performs proper relativization during dict merging. | |
5159 'copy_asan_dylib_path': | |
5160 'mac/copy_asan_runtime_dylib.sh', | |
5161 }, | |
5162 'postbuild_name': 'Copy ASan runtime dylib', | |
5163 'action': [ | |
5164 '<(copy_asan_dylib_path)', | |
5165 ], | |
5166 }, | |
5167 ], | |
5168 }], | |
5169 ], | |
5170 }], | |
5171 ], | |
5172 }], | |
5173 ], # target_conditions | |
5174 }, # target_defaults | |
5175 }], # OS=="mac" or OS=="ios" | |
5176 ['OS=="mac"', { | |
5177 'target_defaults': { | |
5178 'defines': [ | |
5179 # Prevent Mac OS X AssertMacros.h from defining macros that collide | |
5180 # with common names, like 'check', 'require', and 'verify'. | |
5181 # (Included by system header. Also exists on iOS but not included.) | |
5182 # http://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/
AssertMacros.h | |
5183 '__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0', | |
5184 ], | |
5185 'variables': { | |
5186 # These should end with %, but there seems to be a bug with % in | |
5187 # variables that are intended to be set to different values in | |
5188 # different targets, like these. | |
5189 # Strip debugging symbols from the target. | |
5190 'mac_strip': '<(mac_strip_release)', | |
5191 'conditions': [ | |
5192 ['asan==1', { | |
5193 'conditions': [ | |
5194 ['mac_want_real_dsym=="default"', { | |
5195 'mac_real_dsym': 1, | |
5196 }, { | |
5197 'mac_real_dsym': '<(mac_want_real_dsym)' | |
5198 }], | |
5199 ], | |
5200 }, { | |
5201 'conditions': [ | |
5202 ['mac_want_real_dsym=="default"', { | |
5203 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases. | |
5204 }, { | |
5205 'mac_real_dsym': '<(mac_want_real_dsym)' | |
5206 }], | |
5207 ], | |
5208 }], | |
5209 ], | |
5210 }, | |
5211 'configurations': { | |
5212 'Release_Base': { | |
5213 'conditions': [ | |
5214 ['branding=="Chrome" and buildtype=="Official"', { | |
5215 'xcode_settings': { | |
5216 'OTHER_CFLAGS': [ | |
5217 # The Google Chrome Framework dSYM generated by dsymutil has | |
5218 # grown larger than 4GB, which dsymutil can't handle. Reduce | |
5219 # the amount of debug symbols. | |
5220 '-fno-standalone-debug', # See http://crbug.com/479841 | |
5221 ] | |
5222 }, | |
5223 }], | |
5224 ], | |
5225 }, # configuration "Release" | |
5226 }, # configurations | |
5227 'xcode_settings': { | |
5228 # Tell the compiler to use libc++'s headers and the linker to link | |
5229 # against libc++. The latter part normally requires OS X 10.7, | |
5230 # but we still support running on 10.6. How does this work? Two | |
5231 # parts: | |
5232 # 1. Chromium's clang doesn't error on -mmacosx-version-min=10.6 | |
5233 # combined with -stdlib=libc++ (it normally silently produced a | |
5234 # binary that doesn't run on 10.6) | |
5235 # 2. Further down, library_dirs is set to | |
5236 # third_party/libc++-static, which contains a static | |
5237 # libc++.a library. The linker then links against that instead | |
5238 # of against /usr/lib/libc++.dylib when it sees the -lc++ flag | |
5239 # added by the driver. | |
5240 # | |
5241 # In component builds, just link to the system libc++. This has | |
5242 # the effect of making everything depend on libc++, which means | |
5243 # component-build binaries won't run on 10.6 (no libc++ there), | |
5244 # but for a developer-only configuration that's ok. (We don't | |
5245 # want to raise the deployment target yet so that official and | |
5246 # dev builds have the same deployment target. This affects | |
5247 # things like which functions are considered deprecated.) | |
5248 'CLANG_CXX_LIBRARY': 'libc++', # -stdlib=libc++ | |
5249 | |
5250 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic | |
5251 # (Equivalent to -fPIC) | |
5252 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min | |
5253 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)', | |
5254 # Keep pch files below xcodebuild/. | |
5255 'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHe
aders', | |
5256 'OTHER_CFLAGS': [ | |
5257 # Someday this can be replaced by an 'GCC_STRICT_ALIASING': 'NO' | |
5258 # xcode_setting, but not until all downstream projects' mac bots are | |
5259 # using xcode >= 4.6, because that's when the default value of the | |
5260 # flag in the compiler switched. Pre-4.6, the value 'NO' for that | |
5261 # setting is a no-op as far as xcode is concerned, but the compiler | |
5262 # behaves differently based on whether -fno-strict-aliasing is | |
5263 # specified or not. | |
5264 '-fno-strict-aliasing', # See http://crbug.com/32204. | |
5265 ], | |
5266 }, | |
5267 'target_conditions': [ | |
5268 ['>(nacl_untrusted_build)==0 and component=="static_library"', { | |
5269 # See the comment for CLANG_CXX_LIBRARY above for what this does. | |
5270 # The NaCl toolchains have their own toolchain and don't need this. | |
5271 # ASan requires 10.7+ and clang implicitly adds -lc++abi in ASan | |
5272 # mode. Our libc++.a contains both libc++ and libc++abi in one | |
5273 # library, so it doesn't work in that mode. | |
5274 'conditions': [ | |
5275 ['asan==0', { | |
5276 'library_dirs': [ '<(DEPTH)/third_party/libc++-static' ], | |
5277 }], | |
5278 ], | |
5279 }], | |
5280 ['_type=="executable"', { | |
5281 # Turn on position-independence (ASLR) for executables. When | |
5282 # PIE is on for the Chrome executables, the framework will | |
5283 # also be subject to ASLR. | |
5284 'xcode_settings': { | |
5285 'OTHER_LDFLAGS': [ | |
5286 '-Wl,-pie', # Position-independent executable (MH_PIE) | |
5287 ], | |
5288 }, | |
5289 }], | |
5290 ['(_type=="executable" or _type=="shared_library" or \ | |
5291 _type=="loadable_module") and mac_strip!=0', { | |
5292 'target_conditions': [ | |
5293 ['mac_real_dsym == 1', { | |
5294 # To get a real .dSYM bundle produced by dsymutil, set the | |
5295 # debug information format to dwarf-with-dsym. Since | |
5296 # strip_from_xcode will not be used, set Xcode to do the | |
5297 # stripping as well. | |
5298 'configurations': { | |
5299 'Release_Base': { | |
5300 'xcode_settings': { | |
5301 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym', | |
5302 'DEPLOYMENT_POSTPROCESSING': 'YES', | |
5303 'STRIP_INSTALLED_PRODUCT': 'YES', | |
5304 'conditions': [ | |
5305 # Only strip non-ASan builds. | |
5306 ['asan==0', { | |
5307 'target_conditions': [ | |
5308 ['_type=="shared_library" or _type=="loadable_module
"', { | |
5309 # The Xcode default is to strip debugging symbols | |
5310 # only (-S). Local symbols should be stripped as | |
5311 # well, which will be handled by -x. Xcode will | |
5312 # continue to insert -S when stripping even when | |
5313 # additional flags are added with STRIPFLAGS. | |
5314 'STRIPFLAGS': '-x', | |
5315 }], # _type=="shared_library" or _type=="loadable_m
odule" | |
5316 ], # target_conditions | |
5317 }, { # asan != 0 | |
5318 'STRIPFLAGS': '-S', | |
5319 }], | |
5320 ], | |
5321 }, # xcode_settings | |
5322 }, # configuration "Release" | |
5323 }, # configurations | |
5324 }, { # mac_real_dsym != 1 | |
5325 # To get a fast fake .dSYM bundle, use a post-build step to | |
5326 # produce the .dSYM and strip the executable. strip_from_xcode | |
5327 # only operates in the Release configuration. | |
5328 'postbuilds': [ | |
5329 { | |
5330 'variables': { | |
5331 # Define strip_from_xcode in a variable ending in _path | |
5332 # so that gyp understands it's a path and performs proper | |
5333 # relativization during dict merging. | |
5334 'strip_from_xcode_path': 'mac/strip_from_xcode', | |
5335 }, | |
5336 'postbuild_name': 'Strip If Needed', | |
5337 'action': ['<(strip_from_xcode_path)'], | |
5338 }, | |
5339 ], # postbuilds | |
5340 }], # mac_real_dsym | |
5341 ], # target_conditions | |
5342 }], # (_type=="executable" or _type=="shared_library" or | |
5343 # _type=="loadable_module") and mac_strip!=0 | |
5344 ], # target_conditions | |
5345 }, # target_defaults | |
5346 }], # OS=="mac" | |
5347 ['OS=="ios"', { | |
5348 'target_defaults': { | |
5349 'xcode_settings' : { | |
5350 'ENABLE_BITCODE': 'NO', | |
5351 'CLANG_CXX_LIBRARY': 'libc++', # -stdlib=libc++ | |
5352 | |
5353 'conditions': [ | |
5354 # Older Xcodes do not support -Wno-deprecated-register, so pass an | |
5355 # additional flag to suppress the "unknown compiler option" error. | |
5356 # Restrict this flag to builds that are either compiling with Xcode | |
5357 # or compiling with Xcode's Clang. This will allow Ninja builds to | |
5358 # continue failing on unknown compiler options. | |
5359 # TODO(rohitrao): This flag is temporary and should be removed as | |
5360 # soon as the iOS bots are updated to use Xcode 5.1. | |
5361 ['clang_xcode==1', { | |
5362 'WARNING_CFLAGS': [ | |
5363 '-Wno-unknown-warning-option', | |
5364 # It's not possible to achieve nullability completeness before | |
5365 # all builders are running Xcode 7. crbug.com/499809 | |
5366 '-Wno-nullability-completeness', | |
5367 ], | |
5368 'OTHER_CPLUSPLUSFLAGS': [ | |
5369 '$(inherited)', | |
5370 # TODO(ios): Remove once Xcode's libc++ has LLVM r256325 | |
5371 '-isystem <!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Relea
se+Asserts/include/c++/v1', | |
5372 ], | |
5373 }], | |
5374 | |
5375 # Limit the valid architectures depending on "target_subarch". | |
5376 # This need to include the "arm" architectures but also the "x86" | |
5377 # ones (they are used when building for the simulator). | |
5378 ['target_subarch=="arm32"', { | |
5379 'VALID_ARCHS': ['armv7', 'i386'], | |
5380 }], | |
5381 ['target_subarch=="arm64"', { | |
5382 'VALID_ARCHS': ['arm64', 'x86_64'], | |
5383 }], | |
5384 ['target_subarch=="both"', { | |
5385 'VALID_ARCHS': ['arm64', 'armv7', 'x86_64', 'i386'], | |
5386 }], | |
5387 ], | |
5388 }, | |
5389 'target_conditions': [ | |
5390 ['_toolset=="host"', { | |
5391 'xcode_settings': { | |
5392 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot | |
5393 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)', | |
5394 'VALID_ARCHS': [ | |
5395 'x86_64', | |
5396 ], | |
5397 'ARCHS': [ | |
5398 'x86_64', | |
5399 ], | |
5400 }, | |
5401 }], | |
5402 ['_toolset=="target"', { | |
5403 'xcode_settings': { | |
5404 # This section should be for overriding host settings. But, | |
5405 # since we can't negate the iphone deployment target above, we | |
5406 # instead set it here for target only. | |
5407 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)', | |
5408 'ARCHS': ['$(ARCHS_STANDARD_INCLUDING_64_BIT)'], | |
5409 }, | |
5410 }], | |
5411 ['_type=="executable"', { | |
5412 'configurations': { | |
5413 'Release_Base': { | |
5414 'xcode_settings': { | |
5415 'DEPLOYMENT_POSTPROCESSING': 'YES', | |
5416 'STRIP_INSTALLED_PRODUCT': 'YES', | |
5417 'conditions': [ | |
5418 ['buildtype=="Official"', { | |
5419 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym', | |
5420 }, { | |
5421 # Remove dSYM to reduce build time. | |
5422 'DEBUG_INFORMATION_FORMAT': 'dwarf', | |
5423 }], | |
5424 ], | |
5425 }, | |
5426 }, | |
5427 'Debug_Base': { | |
5428 'xcode_settings': { | |
5429 # Remove dSYM to reduce build time. | |
5430 'DEBUG_INFORMATION_FORMAT': 'dwarf', | |
5431 }, | |
5432 }, | |
5433 }, | |
5434 'xcode_settings': { | |
5435 'conditions': [ | |
5436 ['chromium_ios_signing', { | |
5437 # iOS SDK wants everything for device signed. | |
5438 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '<(chromium_ios_signing_i
dentity)', | |
5439 }, { | |
5440 'CODE_SIGNING_REQUIRED': 'NO', | |
5441 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '', | |
5442 }], | |
5443 ], | |
5444 }, | |
5445 }], | |
5446 ], # target_conditions | |
5447 }, # target_defaults | |
5448 }], # OS=="ios" | |
5449 ['OS=="win"', { | |
5450 'target_defaults': { | |
5451 'defines': [ | |
5452 '_WIN32_WINNT=0x0A00', | |
5453 'WINVER=0x0A00', | |
5454 'WIN32', | |
5455 '_WINDOWS', | |
5456 'NOMINMAX', | |
5457 'PSAPI_VERSION=1', | |
5458 '_CRT_RAND_S', | |
5459 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS', | |
5460 'WIN32_LEAN_AND_MEAN', | |
5461 '_ATL_NO_OPENGL', | |
5462 '_SECURE_ATL', | |
5463 # _HAS_EXCEPTIONS must match ExceptionHandling in msvs_settings. | |
5464 '_HAS_EXCEPTIONS=0', | |
5465 # Silence some warnings; we can't switch the the 'recommended' | |
5466 # versions as they're not available on old OSs. | |
5467 '_WINSOCK_DEPRECATED_NO_WARNINGS', | |
5468 ], | |
5469 'conditions': [ | |
5470 ['buildtype=="Official"', { | |
5471 # In official builds, targets can self-select an optimization | |
5472 # level by defining a variable named 'optimize', and setting it | |
5473 # to one of | |
5474 # - "size", optimizes for minimal code size - the default. | |
5475 # - "speed", optimizes for speed over code size. | |
5476 # - "max", whole program optimization and link-time code | |
5477 # generation. This is very expensive and should be used | |
5478 # sparingly. | |
5479 'variables': { | |
5480 'optimize%': 'size', | |
5481 }, | |
5482 'msvs_settings': { | |
5483 'VCLinkerTool': { | |
5484 # Set /LTCG for the official builds. | |
5485 'LinkTimeCodeGeneration': '1', | |
5486 'AdditionalOptions': [ | |
5487 # Set the number of LTCG code-gen threads to eight. | |
5488 # The default is four. This gives a 5-10% link speedup. | |
5489 '/cgthreads:8', | |
5490 ], | |
5491 }, | |
5492 }, | |
5493 'target_conditions': [ | |
5494 ['optimize=="size"', { | |
5495 'msvs_settings': { | |
5496 'VCCLCompilerTool': { | |
5497 # 1, optimizeMinSpace, Minimize Size (/O1) | |
5498 'Optimization': '1', | |
5499 # 2, favorSize - Favor small code (/Os) | |
5500 'FavorSizeOrSpeed': '2', | |
5501 'conditions': [ | |
5502 # TODO(thakis): Remove clang==0 here, crbug.com/598772 | |
5503 ['full_wpo_on_official==1 and clang==0', { | |
5504 # This implies link time code generation. | |
5505 'WholeProgramOptimization': 'true', | |
5506 }], | |
5507 ], | |
5508 }, | |
5509 }, | |
5510 }], | |
5511 # This config is used to avoid a problem in ffmpeg, see | |
5512 # http://crbug.com/264459. | |
5513 ['optimize=="size_no_ltcg"', { | |
5514 'msvs_settings': { | |
5515 'VCCLCompilerTool': { | |
5516 # 1, optimizeMinSpace, Minimize Size (/O1) | |
5517 'Optimization': '1', | |
5518 # 2, favorSize - Favor small code (/Os) | |
5519 'FavorSizeOrSpeed': '2', | |
5520 }, | |
5521 }, | |
5522 }], | |
5523 ['optimize=="speed"', { | |
5524 'msvs_settings': { | |
5525 'VCCLCompilerTool': { | |
5526 # 2, optimizeMaxSpeed, Maximize Speed (/O2) | |
5527 'Optimization': '2', | |
5528 # 1, favorSpeed - Favor fast code (/Ot) | |
5529 'FavorSizeOrSpeed': '1', | |
5530 'conditions': [ | |
5531 # TODO(thakis): Remove clang==0 here, crbug.com/598772 | |
5532 ['full_wpo_on_official==1 and clang==0', { | |
5533 # This implies link time code generation. | |
5534 'WholeProgramOptimization': 'true', | |
5535 }], | |
5536 ], | |
5537 }, | |
5538 }, | |
5539 }], | |
5540 ['optimize=="max"', { | |
5541 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO | |
5542 # builds. Probably anything that this would catch that | |
5543 # wouldn't be caught in a normal build isn't going to | |
5544 # actually be a bug, so the incremental value of C4702 for | |
5545 # PGO builds is likely very small. | |
5546 'msvs_disabled_warnings': [ | |
5547 4702 | |
5548 ], | |
5549 'msvs_settings': { | |
5550 'VCCLCompilerTool': { | |
5551 # 2, optimizeMaxSpeed, Maximize Speed (/O2) | |
5552 'Optimization': '2', | |
5553 # 1, favorSpeed - Favor fast code (/Ot) | |
5554 'FavorSizeOrSpeed': '1', | |
5555 }, | |
5556 }, | |
5557 # TODO(thakis): Remove clang==0 here, https://crbug.com/598772 | |
5558 'conditions': [ | |
5559 ['clang==0', { | |
5560 'msvs_settings': { | |
5561 'VCCLCompilerTool': { | |
5562 # This implies link time code generation. | |
5563 'WholeProgramOptimization': 'true', | |
5564 }, | |
5565 }, | |
5566 }], | |
5567 ], | |
5568 }], | |
5569 ], | |
5570 }], | |
5571 ['msvs_xtree_patched!=1', { | |
5572 # If xtree hasn't been patched, then we disable C4702. Otherwise, | |
5573 # it's enabled. This will generally only be true for system-level | |
5574 # installed Express users. | |
5575 'msvs_disabled_warnings': [ | |
5576 4702, # unreachable code | |
5577 ], | |
5578 }], | |
5579 ['full_wpo_on_official==1', { | |
5580 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO | |
5581 # builds. Probably anything that this would catch that | |
5582 # wouldn't be caught in a normal build isn't going to | |
5583 # actually be a bug, so the incremental value of C4702 for | |
5584 # PGO builds is likely very small. | |
5585 'msvs_disabled_warnings': [ | |
5586 4702 | |
5587 ], | |
5588 }], | |
5589 ], | |
5590 # Add extra include directories here that need to be in front of the | |
5591 # installed and packaged include directories. This may be needed in | |
5592 # order to force a particular SDK version, such as to get VS 2013 to use | |
5593 # the Windows 10 SDK. Beware of making the INCLUDE variable excessively | |
5594 # long, and be sure to make corresponding changes to | |
5595 # build\toolchain\win\setup_toolchain.py | |
5596 'msvs_system_include_dirs': [ | |
5597 ], | |
5598 'msvs_disabled_warnings': [ | |
5599 # C4091: 'typedef ': ignored on left of 'X' when no variable is | |
5600 # declared. | |
5601 # This happens in a number of Windows headers. Dumb. | |
5602 4091, | |
5603 | |
5604 # C4127: conditional expression is constant | |
5605 # This warning can in theory catch dead code and other problems, but | |
5606 # triggers in far too many desirable cases where the conditional | |
5607 # expression is either set by macros or corresponds some legitimate | |
5608 # compile-time constant expression (due to constant template args, | |
5609 # conditionals comparing the sizes of different types, etc.). Some of | |
5610 # these can be worked around, but it's not worth it. | |
5611 4127, | |
5612 | |
5613 # C4351: new behavior: elements of array 'array' will be default | |
5614 # initialized | |
5615 # This is a silly "warning" that basically just alerts you that the | |
5616 # compiler is going to actually follow the language spec like it's | |
5617 # supposed to, instead of not following it like old buggy versions | |
5618 # did. There's absolutely no reason to turn this on. | |
5619 4351, | |
5620 | |
5621 # C4355: 'this': used in base member initializer list | |
5622 # It's commonly useful to pass |this| to objects in a class' | |
5623 # initializer list. While this warning can catch real bugs, most of | |
5624 # the time the constructors in question don't attempt to call methods | |
5625 # on the passed-in pointer (until later), and annotating every legit | |
5626 # usage of this is simply more hassle than the warning is worth. | |
5627 4355, | |
5628 | |
5629 # C4503: 'identifier': decorated name length exceeded, name was | |
5630 # truncated | |
5631 # This only means that some long error messages might have truncated | |
5632 # identifiers in the presence of lots of templates. It has no effect | |
5633 # on program correctness and there's no real reason to waste time | |
5634 # trying to prevent it. | |
5635 4503, | |
5636 | |
5637 # Warning C4589 says: "Constructor of abstract class ignores | |
5638 # initializer for virtual base class." Disable this warning because it | |
5639 # is flaky in VS 2015 RTM. It triggers on compiler generated | |
5640 # copy-constructors in some cases. | |
5641 4589, | |
5642 | |
5643 # C4611: interaction between 'function' and C++ object destruction is | |
5644 # non-portable | |
5645 # This warning is unavoidable when using e.g. setjmp/longjmp. MSDN | |
5646 # suggests using exceptions instead of setjmp/longjmp for C++, but | |
5647 # Chromium code compiles without exception support. We therefore have | |
5648 # to use setjmp/longjmp for e.g. JPEG decode error handling, which | |
5649 # means we have to turn off this warning (and be careful about how | |
5650 # object destruction happens in such cases). | |
5651 4611, | |
5652 | |
5653 # TODO(maruel): These warnings are level 4. They will be slowly | |
5654 # removed as code is fixed. | |
5655 4100, # Unreferenced formal parameter | |
5656 4121, # Alignment of a member was sensitive to packing | |
5657 4244, # Conversion from 'type1' to 'type2', possible loss of data | |
5658 4505, # Unreferenced local function has been removed | |
5659 4510, # Default constructor could not be generated | |
5660 4512, # Assignment operator could not be generated | |
5661 4610, # Object can never be instantiated | |
5662 4838, # Narrowing conversion. Doesn't seem to be very useful. | |
5663 4995, # 'X': name was marked as #pragma deprecated | |
5664 4996, # 'X': was declared deprecated (for GetVersionEx). | |
5665 | |
5666 # These are variable shadowing warnings that are new in VS2015. We | |
5667 # should work through these at some point -- they may be removed from | |
5668 # the RTM release in the /W4 set. | |
5669 4456, 4457, 4458, 4459, | |
5670 | |
5671 # TODO(brucedawson): http://crbug.com/554200 4312 is a VS | |
5672 # 2015 64-bit warning for integer to larger pointer | |
5673 4312, | |
5674 | |
5675 # TODO(brucedawson): http://crbug.com/593448 - C4595 is an 'illegal | |
5676 # inline operator new' warning that is new in VS 2015 Update 2. | |
5677 # This is equivalent to clang's no-inline-new-delete warning. | |
5678 # See http://bugs.icu-project.org/trac/ticket/11122 | |
5679 4595, | |
5680 ], | |
5681 'msvs_settings': { | |
5682 'VCCLCompilerTool': { | |
5683 'AdditionalOptions': ['/MP'], | |
5684 'MinimalRebuild': 'false', | |
5685 'BufferSecurityCheck': 'true', | |
5686 'EnableFunctionLevelLinking': 'true', | |
5687 'RuntimeTypeInfo': 'false', | |
5688 'WarningLevel': '4', | |
5689 'WarnAsError': 'true', | |
5690 'DebugInformationFormat': '3', | |
5691 # ExceptionHandling must match _HAS_EXCEPTIONS above. | |
5692 'ExceptionHandling': '0', | |
5693 }, | |
5694 'VCLibrarianTool': { | |
5695 'AdditionalOptions': ['/ignore:4221'], | |
5696 'AdditionalLibraryDirectories': [ | |
5697 '<(windows_sdk_path)/Lib/win8/um/x86', | |
5698 ], | |
5699 }, | |
5700 'VCLinkerTool': { | |
5701 'AdditionalDependencies': [ | |
5702 'wininet.lib', | |
5703 'dnsapi.lib', | |
5704 'version.lib', | |
5705 'msimg32.lib', | |
5706 'ws2_32.lib', | |
5707 'usp10.lib', | |
5708 'psapi.lib', | |
5709 'dbghelp.lib', | |
5710 'winmm.lib', | |
5711 'shlwapi.lib', | |
5712 ], | |
5713 'AdditionalLibraryDirectories': [ | |
5714 '<(windows_sdk_path)/Lib/win8/um/x86', | |
5715 ], | |
5716 'GenerateDebugInformation': 'true', | |
5717 'MapFileName': '$(OutDir)\\$(TargetName).map', | |
5718 'FixedBaseAddress': '1', | |
5719 # SubSystem values: | |
5720 # 0 == not set | |
5721 # 1 == /SUBSYSTEM:CONSOLE | |
5722 # 2 == /SUBSYSTEM:WINDOWS | |
5723 # Most of the executables we'll ever create are tests | |
5724 # and utilities with console output. | |
5725 'SubSystem': '1', | |
5726 }, | |
5727 'VCMIDLTool': { | |
5728 'GenerateStublessProxies': 'true', | |
5729 'TypeLibraryName': '$(InputName).tlb', | |
5730 'OutputDirectory': '$(IntDir)', | |
5731 'HeaderFileName': '$(InputName).h', | |
5732 'DLLDataFileName': '$(InputName).dlldata.c', | |
5733 'InterfaceIdentifierFileName': '$(InputName)_i.c', | |
5734 'ProxyFileName': '$(InputName)_p.c', | |
5735 }, | |
5736 'VCResourceCompilerTool': { | |
5737 'Culture' : '1033', | |
5738 'AdditionalIncludeDirectories': [ | |
5739 '<(DEPTH)', | |
5740 '<(SHARED_INTERMEDIATE_DIR)', | |
5741 ], | |
5742 }, | |
5743 'target_conditions': [ | |
5744 ['_type=="executable"', { | |
5745 'VCManifestTool': { | |
5746 'EmbedManifest': 'true', | |
5747 }, | |
5748 }], | |
5749 ['_type=="executable" and ">(win_exe_compatibility_manifest)"!=""',
{ | |
5750 'VCManifestTool': { | |
5751 'AdditionalManifestFiles': [ | |
5752 '>(win_exe_compatibility_manifest)', | |
5753 ], | |
5754 }, | |
5755 }], | |
5756 ], | |
5757 'conditions': [ | |
5758 # Building with Clang on Windows is a work in progress and very | |
5759 # experimental. See crbug.com/82385. | |
5760 # Keep this in sync with the similar blocks in build/config/compiler
/BUILD.gn | |
5761 ['clang==1', { | |
5762 'VCCLCompilerTool': { | |
5763 'AdditionalOptions': [ | |
5764 # Don't warn about unused function parameters. | |
5765 # (This is also used on other platforms.) | |
5766 '-Wno-unused-parameter', | |
5767 # Don't warn about the "struct foo f = {0};" initialization | |
5768 # pattern. | |
5769 '-Wno-missing-field-initializers', | |
5770 | |
5771 # TODO(hans): Make this list shorter eventually, http://crbug.
com/504657 | |
5772 '-Wno-microsoft-enum-value', # http://crbug.com/505296 | |
5773 '-Wno-unknown-pragmas', # http://crbug.com/505314 | |
5774 '-Wno-microsoft-cast', # http://crbug.com/550065 | |
5775 ], | |
5776 }, | |
5777 }], | |
5778 ['clang==1 and clang_use_chrome_plugins==1', { | |
5779 'VCCLCompilerTool': { | |
5780 'AdditionalOptions': [ | |
5781 '<@(clang_chrome_plugins_flags)', | |
5782 ], | |
5783 }, | |
5784 }], | |
5785 ['clang==1 and MSVS_VERSION == "2013"', { | |
5786 'VCCLCompilerTool': { | |
5787 'AdditionalOptions': [ | |
5788 '-fmsc-version=1800', | |
5789 ], | |
5790 }, | |
5791 }], | |
5792 ['clang==1 and MSVS_VERSION == "2015"', { | |
5793 'VCCLCompilerTool': { | |
5794 'AdditionalOptions': [ | |
5795 '-fmsc-version=1900', | |
5796 ], | |
5797 }, | |
5798 }], | |
5799 ['clang==1 and "<!(python <(DEPTH)/build/win/use_ansi_codes.py)"=="T
rue"', { | |
5800 'VCCLCompilerTool': { | |
5801 'AdditionalOptions': [ | |
5802 # cmd.exe doesn't understand ANSI escape codes by default, | |
5803 # so only enable them if something emulating them is around. | |
5804 '-fansi-escape-codes', | |
5805 # Also see http://crbug.com/110262 | |
5806 '-fcolor-diagnostics', | |
5807 ], | |
5808 }, | |
5809 }], | |
5810 ], | |
5811 }, | |
5812 }, | |
5813 }], | |
5814 ['disable_nacl==1', { | |
5815 'target_defaults': { | |
5816 'defines': [ | |
5817 'DISABLE_NACL', | |
5818 ], | |
5819 }, | |
5820 }], | |
5821 ['OS=="win" and msvs_use_common_linker_extras', { | |
5822 'target_defaults': { | |
5823 'msvs_settings': { | |
5824 'VCLinkerTool': { | |
5825 'DelayLoadDLLs': [ | |
5826 'dbghelp.dll', | |
5827 'dwmapi.dll', | |
5828 'shell32.dll', | |
5829 'uxtheme.dll', | |
5830 ], | |
5831 }, | |
5832 }, | |
5833 'configurations': { | |
5834 'x86_Base': { | |
5835 'msvs_settings': { | |
5836 'VCLinkerTool': { | |
5837 'AdditionalOptions': [ | |
5838 '/safeseh', | |
5839 '/dynamicbase', | |
5840 '/ignore:4199', | |
5841 '/ignore:4221', | |
5842 '/nxcompat', | |
5843 '/largeaddressaware', | |
5844 ], | |
5845 }, | |
5846 'conditions': [ | |
5847 ['asan==1', { | |
5848 # TODO(asan/win): Move this down into the general | |
5849 # win-target_defaults section once the 64-bit asan runtime | |
5850 # exists. See crbug.com/345874. | |
5851 'VCCLCompilerTool': { | |
5852 'AdditionalOptions': [ | |
5853 '-fsanitize=address', | |
5854 '-fsanitize-blacklist=<(PRODUCT_DIR)/../../tools/memory/as
an/blacklist_win.txt', | |
5855 # Omit variable info to speed up /Z7 links. | |
5856 '-gline-tables-only', | |
5857 ], | |
5858 'AdditionalIncludeDirectories': [ | |
5859 # MSVC needs to be able to find the sanitizer headers when | |
5860 # invoked via /fallback. This is critical for using macros | |
5861 # like ASAN_UNPOISON_MEMORY_REGION in files where we fall | |
5862 # back. | |
5863 '<(DEPTH)/<(make_clang_dir)/lib/clang/<!(python <(DEPTH)/t
ools/clang/scripts/update.py --print-clang-version)/include_sanitizer', | |
5864 ], | |
5865 }, | |
5866 'VCLinkerTool': { | |
5867 'AdditionalLibraryDirectories': [ | |
5868 # TODO(hans): If make_clang_dir is absolute, this breaks. | |
5869 '<(DEPTH)/<(make_clang_dir)/lib/clang/<!(python <(DEPTH)/t
ools/clang/scripts/update.py --print-clang-version)/lib/windows', | |
5870 ], | |
5871 }, | |
5872 'target_conditions': [ | |
5873 ['component=="shared_library"', { | |
5874 'VCLinkerTool': { | |
5875 'AdditionalDependencies': [ | |
5876 'clang_rt.asan_dynamic-i386.lib', | |
5877 'clang_rt.asan_dynamic_runtime_thunk-i386.lib', | |
5878 ], | |
5879 }, | |
5880 }], | |
5881 ['_type=="executable" and component=="static_library"', { | |
5882 'VCLinkerTool': { | |
5883 'AdditionalDependencies': [ | |
5884 'clang_rt.asan-i386.lib', | |
5885 ], | |
5886 }, | |
5887 }], | |
5888 ['(_type=="shared_library" or _type=="loadable_module") and
component=="static_library"', { | |
5889 'VCLinkerTool': { | |
5890 'AdditionalDependencies': [ | |
5891 'clang_rt.asan_dll_thunk-i386.lib', | |
5892 ], | |
5893 }, | |
5894 }], | |
5895 ], | |
5896 }], | |
5897 ['sanitizer_coverage!=""', { | |
5898 # TODO(asan/win): Move this down into the general | |
5899 # win-target_defaults section once the 64-bit asan runtime | |
5900 # exists. See crbug.com/345874. | |
5901 'VCCLCompilerTool': { | |
5902 'AdditionalOptions': [ | |
5903 '-fsanitize-coverage=<(sanitizer_coverage)', | |
5904 ], | |
5905 }, | |
5906 }], | |
5907 ], | |
5908 }, | |
5909 'conditions': [ | |
5910 ['sanitizer_coverage!=""', { | |
5911 # TODO(asan/win): Move this down into the general | |
5912 # win-target_defaults section once the 64-bit asan runtime | |
5913 # exists. See crbug.com/345874. | |
5914 'defines': [ | |
5915 'SANITIZER_COVERAGE', | |
5916 ], | |
5917 }], | |
5918 ], | |
5919 }, | |
5920 'x64_Base': { | |
5921 'msvs_settings': { | |
5922 'VCLinkerTool': { | |
5923 'AdditionalOptions': [ | |
5924 # safeseh is not compatible with x64 | |
5925 '/dynamicbase', | |
5926 '/ignore:4199', | |
5927 '/ignore:4221', | |
5928 '/nxcompat', | |
5929 ], | |
5930 }, | |
5931 }, | |
5932 }, | |
5933 }, | |
5934 }, | |
5935 }], | |
5936 ['enable_new_npdevice_api==1', { | |
5937 'target_defaults': { | |
5938 'defines': [ | |
5939 'ENABLE_NEW_NPDEVICE_API', | |
5940 ], | |
5941 }, | |
5942 }], | |
5943 # Don't warn about the "typedef 'foo' locally defined but not used" | |
5944 # for gcc 4.8 and higher. | |
5945 # TODO: remove this flag once all builds work. See crbug.com/227506 | |
5946 ['clang==0', { | |
5947 'target_defaults': { | |
5948 'cflags': [ '-Wno-unused-local-typedefs' ], | |
5949 }, | |
5950 }], | |
5951 ['clang==0 and host_clang==1', { | |
5952 'target_defaults': { | |
5953 'target_conditions': [ | |
5954 ['_toolset=="host"', { 'cflags!': [ '-Wno-unused-local-typedefs' ]}], | |
5955 ], | |
5956 }, | |
5957 }], | |
5958 ['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) ' | |
5959 'and OS!="win"', { | |
5960 'make_global_settings': [ | |
5961 ['CC', '<(make_clang_dir)/bin/clang'], | |
5962 ['CXX', '<(make_clang_dir)/bin/clang++'], | |
5963 ['CC.host', '$(CC)'], | |
5964 ['CXX.host', '$(CXX)'], | |
5965 ], | |
5966 }], | |
5967 ['clang==1 and OS=="win"', { | |
5968 'make_global_settings': [ | |
5969 # On Windows, gyp's ninja generator only looks at CC. | |
5970 ['CC', '<(make_clang_dir)/bin/clang-cl'], | |
5971 ], | |
5972 }], | |
5973 ['use_lld==1 and OS=="win"', { | |
5974 'make_global_settings': [ | |
5975 # Limited to Windows because lld-link is the driver that is | |
5976 # compatible with link.exe. | |
5977 ['LD', '<(make_clang_dir)/bin/lld-link'], | |
5978 # lld-link includes a replacement for lib.exe that can produce thin | |
5979 # archives and understands bitcode (for use_lto==1). | |
5980 ['AR', '<(make_clang_dir)/bin/lld-link /lib /llvmlibthin'], | |
5981 ], | |
5982 }], | |
5983 ['OS=="android" and clang==0', { | |
5984 # Hardcode the compiler names in the Makefile so that | |
5985 # it won't depend on the environment at make time. | |
5986 'make_global_settings': [ | |
5987 ['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'], | |
5988 ['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'], | |
5989 ['CC.host', '<(host_cc)'], | |
5990 ['CXX.host', '<(host_cxx)'], | |
5991 ], | |
5992 }], | |
5993 ['OS=="linux" and target_arch=="mipsel" and host_arch!="mipsel" and chromeos
==0 and clang==0', { | |
5994 # Set default mips cross tools on linux. These can be overridden | |
5995 # using CC,CXX,CC.host and CXX.host environment variables. | |
5996 'make_global_settings': [ | |
5997 ['CC', '<!(which mipsel-linux-gnu-gcc)'], | |
5998 ['CXX', '<!(which mipsel-linux-gnu-g++)'], | |
5999 ['CC.host', '<(host_cc)'], | |
6000 ['CXX.host', '<(host_cxx)'], | |
6001 ], | |
6002 }], | |
6003 ['OS=="linux" and target_arch=="arm" and host_arch!="arm" and chromeos==0 an
d clang==0', { | |
6004 # Set default ARM cross tools on linux. These can be overridden | |
6005 # using CC,CXX,CC.host and CXX.host environment variables. | |
6006 'make_global_settings': [ | |
6007 ['CC', '<!(which arm-linux-gnueabihf-gcc)'], | |
6008 ['CXX', '<!(which arm-linux-gnueabihf-g++)'], | |
6009 ['CC.host', '<(host_cc)'], | |
6010 ['CXX.host', '<(host_cxx)'], | |
6011 ], | |
6012 }], | |
6013 ['use_goma==1', { | |
6014 'make_global_settings': [ | |
6015 ['CC_wrapper', '<(gomadir)/gomacc'], | |
6016 ['CXX_wrapper', '<(gomadir)/gomacc'], | |
6017 ['CC.host_wrapper', '<(gomadir)/gomacc'], | |
6018 ['CXX.host_wrapper', '<(gomadir)/gomacc'], | |
6019 ], | |
6020 }], | |
6021 ['use_lto==1', { | |
6022 'target_defaults': { | |
6023 'target_conditions': [ | |
6024 ['_toolset=="target"', { | |
6025 'cflags': [ | |
6026 '-flto', | |
6027 ], | |
6028 'xcode_settings': { | |
6029 'LLVM_LTO': 'YES', | |
6030 }, | |
6031 }], | |
6032 # Work-around for http://openradar.appspot.com/20356002 | |
6033 ['_toolset=="target" and _type!="static_library"', { | |
6034 'xcode_settings': { | |
6035 'OTHER_LDFLAGS': [ | |
6036 '-Wl,-all_load', | |
6037 ], | |
6038 }, | |
6039 }], | |
6040 ], | |
6041 }, | |
6042 }], | |
6043 ['use_lto==1 and clang==0', { | |
6044 'target_defaults': { | |
6045 'target_conditions': [ | |
6046 ['_toolset=="target"', { | |
6047 'cflags': [ | |
6048 '-ffat-lto-objects', | |
6049 ], | |
6050 }], | |
6051 ], | |
6052 }, | |
6053 }], | |
6054 ['use_lto==1 and clang==1', { | |
6055 'target_defaults': { | |
6056 'target_conditions': [ | |
6057 ['_toolset=="target"', { | |
6058 'arflags': [ | |
6059 '--plugin', '../../<(make_clang_dir)/lib/LLVMgold.so', | |
6060 ], | |
6061 'cflags': [ | |
6062 '-fwhole-program-vtables', | |
6063 ], | |
6064 'ldflags': [ | |
6065 '-fwhole-program-vtables', | |
6066 ], | |
6067 }], | |
6068 ], | |
6069 'msvs_settings': { | |
6070 'VCCLCompilerTool': { | |
6071 'AdditionalOptions': [ | |
6072 # TODO(pcc): Add LTO support to clang-cl driver and use it here. | |
6073 '-Xclang', | |
6074 '-emit-llvm-bc', | |
6075 ], | |
6076 }, | |
6077 }, | |
6078 }, | |
6079 }], | |
6080 # Apply a lower LTO optimization level as the default is too slow. | |
6081 ['use_lto==1 and clang==1', { | |
6082 'target_defaults': { | |
6083 'target_conditions': [ | |
6084 ['_toolset=="target"', { | |
6085 'ldflags': [ | |
6086 '-Wl,--plugin-opt,O1', | |
6087 # Allows the linker to apply ICF to the LTO object file. Also, whe
n | |
6088 # targeting ARM, wWithout this flag, LTO produces a .text section | |
6089 # that is larger than the maximum call displacement, preventing th
e | |
6090 # linker from relocating calls (http://llvm.org/PR22999). | |
6091 '-Wl,--plugin-opt,-function-sections', | |
6092 ], | |
6093 }], | |
6094 ['_toolset=="target" and _type!="static_library"', { | |
6095 'xcode_settings': { | |
6096 'OTHER_LDFLAGS': [ | |
6097 '-Wl,-mllvm,-O1', | |
6098 ], | |
6099 }, | |
6100 }], | |
6101 ], | |
6102 'msvs_settings': { | |
6103 'VCLinkerTool': { | |
6104 'AdditionalOptions': [ | |
6105 '/opt:lldlto=1', | |
6106 ], | |
6107 }, | |
6108 }, | |
6109 }, | |
6110 }], | |
6111 ['(use_lto==1 or use_lto_o2==1) and clang==0', { | |
6112 'target_defaults': { | |
6113 'target_conditions': [ | |
6114 ['_toolset=="target"', { | |
6115 'ldflags': [ | |
6116 '-flto=32', | |
6117 ], | |
6118 }], | |
6119 ], | |
6120 }, | |
6121 }], | |
6122 ['(use_lto==1 or use_lto_o2==1) and clang==1', { | |
6123 'target_defaults': { | |
6124 'target_conditions': [ | |
6125 ['_toolset=="target"', { | |
6126 'ldflags': [ | |
6127 '-flto', | |
6128 ], | |
6129 }], | |
6130 ], | |
6131 }, | |
6132 }], | |
6133 ['cfi_diag==1', { | |
6134 'target_defaults': { | |
6135 'target_conditions': [ | |
6136 ['_toolset=="target"', { | |
6137 'cflags': [ | |
6138 '-fno-sanitize-trap=cfi', | |
6139 '-fsanitize-recover=cfi', | |
6140 ], | |
6141 'cflags_cc!': [ | |
6142 '-fno-rtti', | |
6143 ], | |
6144 'cflags!': [ | |
6145 '-fno-rtti', | |
6146 ], | |
6147 'ldflags': [ | |
6148 '-fno-sanitize-trap=cfi', | |
6149 '-fsanitize-recover=cfi', | |
6150 ], | |
6151 'xcode_settings': { | |
6152 'OTHER_CFLAGS': [ | |
6153 '-fno-sanitize-trap=cfi', | |
6154 '-fsanitize-recover=cfi', | |
6155 ], | |
6156 }, | |
6157 'msvs_settings': { | |
6158 'VCCLCompilerTool': { | |
6159 'AdditionalOptions': [ | |
6160 '-fno-sanitize-trap=cfi', | |
6161 '-fsanitize-recover=cfi', | |
6162 ], | |
6163 }, | |
6164 }, | |
6165 }], | |
6166 ['_toolset=="target" and _type!="static_library"', { | |
6167 'xcode_settings': { | |
6168 'OTHER_LDFLAGS': [ | |
6169 '-fno-sanitize-trap=cfi', | |
6170 '-fsanitize-recover=cfi', | |
6171 ], | |
6172 }, | |
6173 }], | |
6174 ], | |
6175 }, | |
6176 }], | |
6177 ['cfi_vptr==1 and cfi_diag==0', { | |
6178 'target_defaults': { | |
6179 'target_conditions': [ | |
6180 ['_toolset=="target"', { | |
6181 'defines': [ | |
6182 'CFI_ENFORCEMENT', | |
6183 ], | |
6184 }], | |
6185 ], | |
6186 }, | |
6187 }], | |
6188 ['cfi_vptr==1', { | |
6189 'target_defaults': { | |
6190 'target_conditions': [ | |
6191 ['_toolset=="target"', { | |
6192 'cflags': [ | |
6193 '-fsanitize=cfi-vcall', | |
6194 '-fsanitize-blacklist=<(cfi_blacklist)', | |
6195 ], | |
6196 'ldflags': [ | |
6197 '-fsanitize=cfi-vcall', | |
6198 '-fsanitize=cfi-derived-cast', | |
6199 '-fsanitize=cfi-unrelated-cast', | |
6200 ], | |
6201 'xcode_settings': { | |
6202 'OTHER_CFLAGS': [ | |
6203 '-fsanitize=cfi-vcall', | |
6204 '-fsanitize-blacklist=<(cfi_blacklist)', | |
6205 ], | |
6206 }, | |
6207 }], | |
6208 ['_toolset=="target" and _type!="static_library"', { | |
6209 'xcode_settings': { | |
6210 'OTHER_LDFLAGS': [ | |
6211 '-fsanitize=cfi-vcall', | |
6212 ], | |
6213 }, | |
6214 }], | |
6215 ], | |
6216 }, | |
6217 }], | |
6218 ['cfi_vptr==1 and cfi_cast==1', { | |
6219 'target_defaults': { | |
6220 'target_conditions': [ | |
6221 ['_toolset=="target"', { | |
6222 'cflags': [ | |
6223 '-fsanitize=cfi-derived-cast', | |
6224 '-fsanitize=cfi-unrelated-cast', | |
6225 ], | |
6226 'ldflags': [ | |
6227 '-fsanitize=cfi-derived-cast', | |
6228 '-fsanitize=cfi-unrelated-cast', | |
6229 ], | |
6230 'xcode_settings': { | |
6231 'OTHER_CFLAGS': [ | |
6232 '-fsanitize=cfi-derived-cast', | |
6233 '-fsanitize=cfi-unrelated-cast', | |
6234 ], | |
6235 }, | |
6236 }], | |
6237 ['_toolset=="target" and _type!="static_library"', { | |
6238 'xcode_settings': { | |
6239 'OTHER_LDFLAGS': [ | |
6240 '-fsanitize=cfi-derived-cast', | |
6241 '-fsanitize=cfi-unrelated-cast', | |
6242 ], | |
6243 }, | |
6244 }], | |
6245 ], | |
6246 }, | |
6247 }], | |
6248 ['cfi_vptr==1 and OS=="win"', { | |
6249 'target_defaults': { | |
6250 'target_conditions': [ | |
6251 ['_toolset=="target"', { | |
6252 'msvs_settings': { | |
6253 'VCCLCompilerTool': { | |
6254 'AdditionalOptions': [ | |
6255 # TODO(pcc): Use regular -fsanitize=* flags here once clang-cl | |
6256 # supports LTO. | |
6257 '-Xclang', | |
6258 '-fsanitize=cfi-vcall', | |
6259 '-Xclang', | |
6260 '-fsanitize=cfi-derived-cast', | |
6261 '-Xclang', | |
6262 '-fsanitize=cfi-unrelated-cast', | |
6263 '-Xclang', | |
6264 '-fsanitize-trap=cfi-vcall', | |
6265 '-Xclang', | |
6266 '-fsanitize-trap=cfi-derived-cast', | |
6267 '-Xclang', | |
6268 '-fsanitize-trap=cfi-unrelated-cast', | |
6269 '-Xclang', | |
6270 '-fsanitize-blacklist=<(cfi_blacklist)', | |
6271 '-Xclang', | |
6272 '-fsanitize-blacklist=../../<(make_clang_dir)/lib/clang/<!(pyt
hon <(DEPTH)/tools/clang/scripts/update.py --print-clang-version)/cfi_blacklist.
txt', | |
6273 ], | |
6274 }, | |
6275 }, | |
6276 }], | |
6277 ], | |
6278 }, | |
6279 }], | |
6280 ], | |
6281 'xcode_settings': { | |
6282 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT! | |
6283 # This block adds *project-wide* configuration settings to each project | |
6284 # file. It's almost always wrong to put things here. Specify your | |
6285 # custom xcode_settings in target_defaults to add them to targets instead. | |
6286 | |
6287 'conditions': [ | |
6288 # In an Xcode Project Info window, the "Base SDK for All Configurations" | |
6289 # setting sets the SDK on a project-wide basis. In order to get the | |
6290 # configured SDK to show properly in the Xcode UI, SDKROOT must be set | |
6291 # here at the project level. | |
6292 ['OS=="mac"', { | |
6293 'ARCHS': [ 'x86_64' ], | |
6294 'conditions': [ | |
6295 ['mac_sdk_path==""', { | |
6296 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot | |
6297 }, { | |
6298 'SDKROOT': '<(mac_sdk_path)', # -isysroot | |
6299 }], | |
6300 ], | |
6301 }], | |
6302 ['OS=="ios"', { | |
6303 # Target both iPhone and iPad. | |
6304 'TARGETED_DEVICE_FAMILY': '1,2', | |
6305 'conditions': [ | |
6306 ['ios_sdk_path==""', { | |
6307 'SDKROOT': 'iphoneos<(ios_sdk)', # -isysroot | |
6308 }, { | |
6309 'SDKROOT': '<(ios_sdk_path)', # -isysroot | |
6310 }], | |
6311 ], | |
6312 }], | |
6313 ], | |
6314 | |
6315 # The Xcode generator will look for an xcode_settings section at the root | |
6316 # of each dict and use it to apply settings on a file-wide basis. Most | |
6317 # settings should not be here, they should be in target-specific | |
6318 # xcode_settings sections, or better yet, should use non-Xcode-specific | |
6319 # settings in target dicts. SYMROOT is a special case, because many other | |
6320 # Xcode variables depend on it, including variables such as | |
6321 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something | |
6322 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the | |
6323 # files to appear (when present) in the UI as actual files and not red | |
6324 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR, | |
6325 # and therefore SYMROOT, needs to be set at the project level. | |
6326 'SYMROOT': '<(DEPTH)/xcodebuild', | |
6327 }, | |
6328 } | 15 } |
OLD | NEW |