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