forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon.gypi
1880 lines (1779 loc) · 69.4 KB
/
common.gypi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# IMPORTANT:
# Please don't directly include this file if you are building via gyp_chromium,
# since gyp_chromium is automatically forcing its inclusion.
{
# Variables expected to be overriden on the GYP command line (-D) or by
# ~/.gyp/include.gypi.
'variables': {
# Putting a variables dict inside another variables dict looks kind of
# weird. This is done so that 'host_arch', 'chromeos', etc are defined as
# variables within the outer variables dict here. This is necessary
# to get these variables defined for the conditions within this variables
# dict that operate on these variables (e.g., for setting 'toolkit_views',
# we need to have 'chromeos' already set).
'variables': {
'variables': {
'variables': {
# Whether we're building a ChromeOS build.
'chromeos%': 0,
# Whether the Views toolkit can use its Pure form when available
# or if it must only use GTK (the default at the moment).
# This is an intermediate step until all of Views is 'Pure',
# at which point we plan to remove those switches.
# This turns on the TOOLKIT_USES_PURE_VIEWS macro which is used
# to replace the corresponding GTK implementation in such a way
# that GTK and PureViews can coexist. This intermediate solution
# allow us to switch the view implementations using
# --use-pure-views, without breaking exiting gtk implementation.
'toolkit_uses_pure_views%': 0,
# Disable touch support by default.
'touchui%': 0,
# Disable webui certificate viewer until it is complete.
'webui_certificate_viewer%': 0,
# Whether the compositor is enabled on views.
'views_compositor%': 0,
},
# Copy conditionally-set variables out one scope.
'chromeos%': '<(chromeos)',
'toolkit_uses_pure_views%': '<(toolkit_uses_pure_views)',
'touchui%': '<(touchui)',
'webui_certificate_viewer%': '<(webui_certificate_viewer)',
'views_compositor%': '<(views_compositor)',
# Compute the architecture that we're building on.
'conditions': [
[ 'OS=="win" or OS=="mac"', {
'host_arch%': 'ia32',
}, {
# This handles the Unix platforms for which there is some support.
# Anything else gets passed through, which probably won't work very
# well; such hosts should pass an explicit target_arch to gyp.
'host_arch%':
'<!(uname -m | sed -e "s/i.86/ia32/;s/x86_64/x64/;s/amd64/x64/;s/arm.*/arm/;s/i86pc/ia32/")',
}],
# Set default value of toolkit_views on for Windows, Chrome OS
# and the touch UI.
['OS=="win" or chromeos==1 or touchui==1 or toolkit_uses_pure_views==1', {
'toolkit_views%': 1,
}, {
'toolkit_views%': 0,
}],
# Views are always Pure in Touch case
['touchui==1', {
'toolkit_uses_pure_views%': 1,
}, {
'toolkit_uses_pure_views%': 0,
}],
# Use WebUI certificate viewer in Touch case
['touchui==1', {
'webui_certificate_viewer%': 1
}],
],
},
# Copy conditionally-set variables out one scope.
'chromeos%': '<(chromeos)',
'touchui%': '<(touchui)',
'webui_certificate_viewer%': '<(webui_certificate_viewer)',
'host_arch%': '<(host_arch)',
'toolkit_views%': '<(toolkit_views)',
'toolkit_uses_pure_views%': '<(toolkit_uses_pure_views)',
'views_compositor%': '<(views_compositor)',
# We used to provide a variable for changing how libraries were built.
# This variable remains until we can clean up all the users.
# This needs to be one nested variables dict in so that dependent
# gyp files can make use of it in their outer variables. (Yikes!)
# http://code.google.com/p/chromium/issues/detail?id=83308
'library%': 'static_library',
# Override branding to select the desired branding flavor.
'branding%': 'Chromium',
# Override buildtype to select the desired build flavor.
# Dev - everyday build for development/testing
# Official - release build (generally implies additional processing)
# TODO(mmoss) Once 'buildtype' is fully supported (e.g. Windows gyp
# conversion is done), some of the things which are now controlled by
# 'branding', such as symbol generation, will need to be refactored based
# on 'buildtype' (i.e. we don't care about saving symbols for non-Official
# builds).
'buildtype%': 'Dev',
# Default architecture we're building for is the architecture we're
# building on.
'target_arch%': '<(host_arch)',
# This variable tells WebCore.gyp and JavaScriptCore.gyp whether they are
# are built under a chromium full build (1) or a webkit.org chromium
# build (0).
'inside_chromium_build%': 1,
# Set to 1 to enable fast builds. It disables debug info for fastest
# compilation.
'fastbuild%': 0,
# Disable file manager component extension by default.
'file_manager_extension%': 0,
# Python version.
'python_ver%': '2.6',
# Set ARM-v7 compilation flags
'armv7%': 0,
# Set Neon compilation flags (only meaningful if armv7==1).
'arm_neon%': 1,
# The system root for cross-compiles. Default: none.
'sysroot%': '',
# On Linux, we build with sse2 for Chromium builds.
'disable_sse2%': 0,
# Use libjpeg-turbo as the JPEG codec used by Chromium.
'use_libjpeg_turbo%': 1,
# Variable 'component' is for cases where we would like to build some
# components as dynamic shared libraries but still need variable
# 'library' for static libraries.
# By default, component is set to whatever library is set to and
# it can be overriden by the GYP command line or by ~/.gyp/include.gypi.
'component%': 'static_library',
# Set to select the Title Case versions of strings in GRD files.
'use_titlecase_in_grd_files%': 0,
# Use translations provided by volunteers at launchpad.net. This
# currently only works on Linux.
'use_third_party_translations%': 0,
# Remoting compilation is enabled by default. Set to 0 to disable.
'remoting%': 1,
# P2P APIs are compiled in by default. Set to 0 to disable.
# Also note that this should be enabled for remoting to compile.
'p2p_apis%': 1,
# Configuration policy is enabled by default. Set to 0 to disable.
'configuration_policy%': 1,
# Safe browsing is compiled in by default. Set to 0 to disable.
'safe_browsing%': 1,
# If this is set, the clang plugins used on the buildbot will be used.
# Run tools/clang/scripts/update.sh to make sure they are compiled.
# This causes 'clang_chrome_plugins_flags' to be set.
# Has no effect if 'clang' is not set as well.
'clang_use_chrome_plugins%': 0,
# Set to 1 compile with -fPIC cflag on linux. This is a must for shared
# libraries on linux x86-64 and arm, plus ASLR.
'linux_fpic%': 1,
# Enable navigator.registerProtocolHandler and supporting UI.
'enable_register_protocol_handler%': 1,
# Smooth scrolling is disabled by default.
'enable_smooth_scrolling%': 0,
# Webrtc compilation is enabled by default. Set to 0 to disable.
'enable_webrtc%': 1,
'conditions': [
# Use Skia as WebKit renderer on Mac
['OS=="mac"', {
'use_skia%': 0,
}, {
'use_skia%': 1,
}],
# A flag for POSIX platforms
['OS=="win"', {
'os_posix%': 0,
}, {
'os_posix%': 1,
}],
# Flags to use Gtk and X11 on non-Mac POSIX platforms
['OS=="win" or OS=="mac"', {
'toolkit_uses_gtk%': 0,
'use_x11%': 0,
}, {
'toolkit_uses_gtk%': 1,
'use_x11%': 1,
}],
# A flag to enable or disable our compile-time dependency
# on gnome-keyring. If that dependency is disabled, no gnome-keyring
# support will be available. This option is useful
# for Linux distributions.
['chromeos==1', {
'use_gnome_keyring%': 0,
}, {
'use_gnome_keyring%': 1,
}],
['toolkit_views==0 or OS=="mac"', {
# GTK+ and Mac wants Title Case strings
'use_titlecase_in_grd_files%': 1,
}],
# Enable some hacks to support Flapper only on Chrome OS.
['chromeos==1', {
'enable_flapper_hacks%': 1,
}, {
'enable_flapper_hacks%': 0,
}],
# Enable file manager extension by default on Chrome OS.
['chromeos==1', {
'file_manager_extension%': 1,
}, {
'file_manager_extension%': 0,
}],
# Enable smooth scrolling for Linux and ChromeOS
['OS=="linux"', {
'enable_smooth_scrolling%': 1,
}, {
'enable_smooth_scrolling%': 0,
}],
],
},
# Copy conditionally-set variables out one scope.
'branding%': '<(branding)',
'buildtype%': '<(buildtype)',
'target_arch%': '<(target_arch)',
'host_arch%': '<(host_arch)',
'library%': 'static_library',
'toolkit_views%': '<(toolkit_views)',
'toolkit_uses_pure_views%': '<(toolkit_uses_pure_views)',
'views_compositor%': '<(views_compositor)',
'os_posix%': '<(os_posix)',
'toolkit_uses_gtk%': '<(toolkit_uses_gtk)',
'use_skia%': '<(use_skia)',
'use_x11%': '<(use_x11)',
'use_gnome_keyring%': '<(use_gnome_keyring)',
'linux_fpic%': '<(linux_fpic)',
'enable_flapper_hacks%': '<(enable_flapper_hacks)',
'chromeos%': '<(chromeos)',
'touchui%': '<(touchui)',
'webui_certificate_viewer%': '<(webui_certificate_viewer)',
'file_manager_extension%': '<(file_manager_extension)',
'inside_chromium_build%': '<(inside_chromium_build)',
'fastbuild%': '<(fastbuild)',
'python_ver%': '<(python_ver)',
'armv7%': '<(armv7)',
'arm_neon%': '<(arm_neon)',
'sysroot%': '<(sysroot)',
'disable_sse2%': '<(disable_sse2)',
'component%': '<(component)',
'use_titlecase_in_grd_files%': '<(use_titlecase_in_grd_files)',
'use_third_party_translations%': '<(use_third_party_translations)',
'remoting%': '<(remoting)',
'enable_webrtc%': '<(enable_webrtc)',
'p2p_apis%': '<(p2p_apis)',
'configuration_policy%': '<(configuration_policy)',
'safe_browsing%': '<(safe_browsing)',
'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
'enable_register_protocol_handler%': '<(enable_register_protocol_handler)',
'enable_smooth_scrolling%': '<(enable_smooth_scrolling)',
# The release channel that this build targets. This is used to restrict
# channel-specific build options, like which installer packages to create.
# The default is 'all', which does no channel-specific filtering.
'channel%': 'all',
# Override chromium_mac_pch and set it to 0 to suppress the use of
# precompiled headers on the Mac. Prefix header injection may still be
# used, but prefix headers will not be precompiled. This is useful when
# using distcc to distribute a build to compile slaves that don't
# share the same compiler executable as the system driving the compilation,
# because precompiled headers rely on pointers into a specific compiler
# executable's image. Setting this to 0 is needed to use an experimental
# Linux-Mac cross compiler distcc farm.
'chromium_mac_pch%': 1,
# Mac OS X SDK and deployment target support.
# The SDK identifies the version of the system headers that will be used,
# and corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time macro.
# "Maximum allowed" refers to the operating system version whose APIs are
# available in the headers.
# The deployment target identifies the minimum system version that the
# built products are expected to function on. It corresponds to the
# MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro.
# To ensure these macros are available, #include <AvailabilityMacros.h>.
# Additional documentation on these macros is available at
# http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
# Chrome normally builds with the Mac OS X 10.5 SDK and sets the
# deployment target to 10.5. Other projects, such as O3D, may override
# these defaults.
'mac_sdk%': '10.5',
'mac_deployment_target%': '10.5',
# Set to 1 to enable code coverage. In addition to build changes
# (e.g. extra CFLAGS), also creates a new target in the src/chrome
# project file called "coverage".
# Currently ignored on Windows.
'coverage%': 0,
# Overridable specification for potential use of alternative
# JavaScript engines.
'javascript_engine%': 'v8',
# Although base/allocator lets you select a heap library via an
# environment variable, the libcmt shim it uses sometimes gets in
# the way. To disable it entirely, and switch to normal msvcrt, do e.g.
# 'win_use_allocator_shim': 0,
# 'win_release_RuntimeLibrary': 2
# to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
'win_use_allocator_shim%': 1, # 1 = shim allocator via libcmt; 0 = msvcrt
# Whether usage of OpenMAX is enabled.
'enable_openmax%': 0,
# Whether proprietary audio/video codecs are assumed to be included with
# this build (only meaningful if branding!=Chrome).
'proprietary_codecs%': 0,
# TODO(bradnelson): eliminate this when possible.
# To allow local gyp files to prevent release.vsprops from being included.
# Yes(1) means include release.vsprops.
# Once all vsprops settings are migrated into gyp, this can go away.
'msvs_use_common_release%': 1,
# TODO(bradnelson): eliminate this when possible.
# To allow local gyp files to override additional linker options for msvs.
# Yes(1) means set use the common linker options.
'msvs_use_common_linker_extras%': 1,
# TODO(sgk): eliminate this if possible.
# It would be nicer to support this via a setting in 'target_defaults'
# in chrome/app/locales/locales.gypi overriding the setting in the
# 'Debug' configuration in the 'target_defaults' dict below,
# but that doesn't work as we'd like.
'msvs_debug_link_incremental%': '2',
# Needed for some of the largest modules.
'msvs_debug_link_nonincremental%': '1',
# This is the location of the sandbox binary. Chrome looks for this before
# running the zygote process. If found, and SUID, it will be used to
# sandbox the zygote process and, thus, all renderer processes.
'linux_sandbox_path%': '',
# Set this to true to enable SELinux support.
'selinux%': 0,
# Set this to true when building with Clang.
# See http://code.google.com/p/chromium/wiki/Clang for details.
# TODO: eventually clang should behave identically to gcc, and this
# won't be necessary.
'clang%': 0,
# These two variables can be set in GYP_DEFINES while running
# |gclient runhooks| to let clang run a plugin in every compilation.
# Only has an effect if 'clang=1' is in GYP_DEFINES as well.
# Example:
# GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dylib clang_add_plugin=print-fns' gclient runhooks
'clang_load%': '',
'clang_add_plugin%': '',
# Enable sampling based profiler.
# See http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
'profiling%': '0',
# Override whether we should use Breakpad on Linux. I.e. for Chrome bot.
'linux_breakpad%': 0,
# And if we want to dump symbols for Breakpad-enabled builds.
'linux_dump_symbols%': 0,
# And if we want to strip the binary after dumping symbols.
'linux_strip_binary%': 0,
# Strip the test binaries needed for Linux reliability tests.
'linux_strip_reliability_tests%': 0,
# Enable TCMalloc.
'linux_use_tcmalloc%': 1,
# Disable TCMalloc's debugallocation.
'linux_use_debugallocation%': 0,
# Disable TCMalloc's heapchecker.
'linux_use_heapchecker%': 0,
# Disable shadow stack keeping used by heapcheck to unwind the stacks
# better.
'linux_keep_shadow_stacks%': 0,
# Set to 1 to turn on seccomp sandbox by default.
# (Note: this is ignored for official builds.)
'linux_use_seccomp_sandbox%': 0,
# Set to 1 to link against libgnome-keyring instead of using dlopen().
'linux_link_gnome_keyring%': 0,
# Set to 1 to link against gsettings APIs instead of using dlopen().
'linux_link_gsettings%': 0,
# Used to disable Native Client at compile time, for platforms where it
# isn't supported
'disable_nacl%': 0,
# Set Thumb compilation flags.
'arm_thumb%': 0,
# Set ARM fpu compilation flags (only meaningful if armv7==1 and
# arm_neon==0).
'arm_fpu%': 'vfpv3',
# Enable new NPDevice API.
'enable_new_npdevice_api%': 0,
# Enable EGLImage support in OpenMAX
'enable_eglimage%': 1,
# Enable a variable used elsewhere throughout the GYP files to determine
# whether to compile in the sources for the GPU plugin / process.
'enable_gpu%': 1,
# Use OpenSSL instead of NSS. Under development: see http://crbug.com/62803
'use_openssl%': 0,
# .gyp files or targets should set chromium_code to 1 if they build
# Chromium-specific code, as opposed to external code. This variable is
# used to control such things as the set of warnings to enable, and
# whether warnings are treated as errors.
'chromium_code%': 0,
# Set to 1 to compile with the built in pdf viewer.
'internal_pdf%': 0,
# This allows to use libcros from the current system, ie. /usr/lib/
# The cros_api will be pulled in as a static library, and all headers
# from the system include dirs.
'system_libcros%': 0,
# NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
# so Cocoa is happy (http://crbug.com/20441).
'locales': [
'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he',
'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
'ml', 'mr', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
'vi', 'zh-CN', 'zh-TW',
],
'grit_defines': [],
# Use Harfbuzz-NG instead of Harfbuzz.
# Under development: http://crbug.com/68551
'use_harfbuzz_ng%': 0,
# If debug_devtools is set to 1, JavaScript files for DevTools are
# stored as is and loaded from disk. Otherwise, a concatenated file
# is stored in resources.pak. It is still possible to load JS files
# from disk by passing --debug-devtools cmdline switch.
'debug_devtools%': 0,
# Point to ICU directory.
'icu_src_dir': '../third_party/icu',
'conditions': [
['os_posix==1 and OS!="mac"', {
# This will set gcc_version to XY if you are running gcc X.Y.*.
# This is used to tweak build flags for gcc 4.4.
'gcc_version%': '<!(python <(DEPTH)/build/compiler_version.py)',
# Figure out the python architecture to decide if we build pyauto.
'python_arch%': '<!(<(DEPTH)/build/linux/python_arch.sh <(sysroot)/usr/lib/libpython<(python_ver).so.1.0)',
'conditions': [
['branding=="Chrome"', {
'linux_breakpad%': 1,
}],
# All Chrome builds have breakpad symbols, but only process the
# symbols from official builds.
['(branding=="Chrome" and buildtype=="Official")', {
'linux_dump_symbols%': 1,
}],
],
}], # os_posix==1 and OS!="mac"
['OS=="mac"', {
'conditions': [
# mac_product_name is set to the name of the .app bundle as it should
# appear on disk. This duplicates data from
# chrome/app/theme/chromium/BRANDING and
# chrome/app/theme/google_chrome/BRANDING, but is necessary to get
# these names into the build system.
['branding=="Chrome"', {
'mac_product_name%': 'Google Chrome',
}, { # else: branding!="Chrome"
'mac_product_name%': 'Chromium',
}],
# Feature variables for enabling Mac Breakpad and Keystone auto-update
# support. Both features are on by default in official builds with
# Chrome branding.
['branding=="Chrome" and buildtype=="Official"', {
'mac_breakpad%': 1,
'mac_keystone%': 1,
}, { # else: branding!="Chrome" or buildtype!="Official"
'mac_breakpad%': 0,
'mac_keystone%': 0,
}],
],
}], # OS=="mac"
# Whether to use multiple cores to compile with visual studio. This is
# optional because it sometimes causes corruption on VS 2005.
# It is on by default on VS 2008 and off on VS 2005.
['OS=="win"', {
'conditions': [
['component=="shared_library"', {
'win_use_allocator_shim%': 0,
}],
['MSVS_VERSION=="2005"', {
'msvs_multi_core_compile%': 0,
},{
'msvs_multi_core_compile%': 1,
}],
# Don't do incremental linking for large modules on 32-bit.
['MSVS_OS_BITS==32', {
'msvs_large_module_debug_link_mode%': '1', # No
},{
'msvs_large_module_debug_link_mode%': '2', # Yes
}],
['MSVS_VERSION=="2010e" or MSVS_VERSION=="2008e" or MSVS_VERSION=="2005e"', {
'msvs_express%': 1,
'secure_atl%': 0,
},{
'msvs_express%': 0,
'secure_atl%': 1,
}],
],
'nacl_win64_defines': [
# This flag is used to minimize dependencies when building
# Native Client loader for 64-bit Windows.
'NACL_WIN64',
],
}],
['os_posix==1 and chromeos==0 and target_arch!="arm"', {
'use_cups%': 1,
}, {
'use_cups%': 0,
}],
# Set the relative path from this file to the GYP file of the JPEG
# library used by Chromium.
['use_libjpeg_turbo==1', {
'libjpeg_gyp_path': '../third_party/libjpeg_turbo/libjpeg.gyp',
}, {
'libjpeg_gyp_path': '../third_party/libjpeg/libjpeg.gyp',
}], # use_libjpeg_turbo==1
# Options controlling the use of GConf (the classic GNOME configuration
# system) and GIO, which contains GSettings (the new GNOME config system).
['chromeos==1', {
'use_gconf%': 0,
'use_gio%': 0,
}, {
'use_gconf%': 1,
'use_gio%': 1,
}],
# Set up -D and -E flags passed into grit.
['branding=="Chrome"', {
# TODO(mmoss) The .grd files look for _google_chrome, but for
# consistency they should look for google_chrome_build like C++.
'grit_defines': ['-D', '_google_chrome',
'-E', 'CHROMIUM_BUILD=google_chrome'],
}, {
'grit_defines': ['-D', '_chromium',
'-E', 'CHROMIUM_BUILD=chromium'],
}],
['chromeos==1', {
'grit_defines': ['-D', 'chromeos'],
}],
['toolkit_views==1', {
'grit_defines': ['-D', 'toolkit_views'],
}],
['toolkit_uses_pure_views==1', {
'grit_defines': ['-D', 'toolkit_uses_pure_views'],
}],
['touchui==1', {
'grit_defines': ['-D', 'touchui'],
}],
['webui_certificate_viewer==1', {
'grit_defines': ['-D', 'webui_certificate_viewer'],
}],
['file_manager_extension==1', {
'grit_defines': ['-D', 'file_manager_extension'],
}],
['remoting==1', {
'grit_defines': ['-D', 'remoting'],
}],
['use_titlecase_in_grd_files==1', {
'grit_defines': ['-D', 'use_titlecase'],
}],
['use_third_party_translations==1', {
'grit_defines': ['-D', 'use_third_party_translations'],
'locales': [
'ast', 'bs', 'ca@valencia', 'eo', 'eu', 'gl', 'hy', 'ka', 'ku', 'kw',
'ug',
],
}],
['clang_use_chrome_plugins==1', {
'clang_chrome_plugins_flags':
'<!(<(DEPTH)/tools/clang/scripts/plugin_flags.sh)',
}],
# Set use_ibus to 1 to enable ibus support.
['touchui==1 and chromeos==1', {
'use_ibus%': 1,
}, {
'use_ibus%': 0,
}],
['enable_register_protocol_handler==1', {
'grit_defines': ['-D', 'enable_register_protocol_handler'],
}],
],
},
'target_defaults': {
'variables': {
# The condition that operates on chromium_code is in a target_conditions
# section, and will not have access to the default fallback value of
# chromium_code at the top of this file, or to the chromium_code
# variable placed at the root variables scope of .gyp files, because
# those variables are not set at target scope. As a workaround,
# if chromium_code is not set at target scope, define it in target scope
# to contain whatever value it has during early variable expansion.
# That's enough to make it available during target conditional
# processing.
'chromium_code%': '<(chromium_code)',
# See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
'mac_release_optimization%': '3', # Use -O3 unless overridden
'mac_debug_optimization%': '0', # Use -O0 unless overridden
# See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
'win_release_Optimization%': '2', # 2 = /Os
'win_debug_Optimization%': '0', # 0 = /Od
# See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off
# See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off,
'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
# VS inserts quite a lot of extra checks to algorithms like
# std::partial_sort in Debug build which make them O(N^2)
# instead of O(N*logN). This is particularly slow under memory
# tools like ThreadSanitizer so we want it to be disablable.
# See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
'win_debug_disable_iterator_debugging%': '0',
'release_extra_cflags%': '',
'debug_extra_cflags%': '',
'release_valgrind_build%': 0,
'conditions': [
['OS=="win" and component=="shared_library"', {
# See http://msdn.microsoft.com/en-us/library/aa652367.aspx
'win_release_RuntimeLibrary%': '2', # 2 = /MT (nondebug DLL)
'win_debug_RuntimeLibrary%': '3', # 3 = /MTd (debug DLL)
}, {
# See http://msdn.microsoft.com/en-us/library/aa652367.aspx
'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
}],
],
},
'conditions': [
['branding=="Chrome"', {
'defines': ['GOOGLE_CHROME_BUILD'],
}, { # else: branding!="Chrome"
'defines': ['CHROMIUM_BUILD'],
}],
['component=="shared_library"', {
'defines': ['COMPONENT_BUILD'],
}],
['toolkit_views==1', {
'defines': ['TOOLKIT_VIEWS=1'],
}],
['toolkit_uses_pure_views==1', {
'defines': ['TOOLKIT_USES_PURE_VIEWS=1'],
}],
['views_compositor==1', {
'defines': ['VIEWS_COMPOSITOR=1'],
}],
['chromeos==1', {
'defines': ['OS_CHROMEOS=1'],
}],
['touchui==1', {
'defines': ['TOUCH_UI=1'],
}],
['file_manager_extension==1', {
'defines': ['FILE_MANAGER_EXTENSION=1'],
}],
['profiling==1', {
'defines': ['ENABLE_PROFILING=1'],
}],
['remoting==1', {
'defines': ['ENABLE_REMOTING=1'],
}],
['p2p_apis==1', {
'defines': ['ENABLE_P2P_APIS=1'],
}],
['proprietary_codecs==1', {
'defines': ['USE_PROPRIETARY_CODECS'],
}],
['enable_flapper_hacks==1', {
'defines': ['ENABLE_FLAPPER_HACKS=1'],
}],
['configuration_policy==1', {
'defines': ['ENABLE_CONFIGURATION_POLICY'],
}],
['fastbuild!=0', {
'conditions': [
# For Windows, we don't genererate debug information.
['OS=="win"', {
'msvs_settings': {
'VCLinkerTool': {
'GenerateDebugInformation': 'false',
},
'VCCLCompilerTool': {
'DebugInformationFormat': '0',
}
}
}, { # else: OS != "win", generate less debug information.
'variables': {
'debug_extra_cflags': '-g1',
},
}],
# Clang creates chubby debug information, which makes linking very
# slow. For now, don't create debug information with clang. See
# http://crbug.com/70000
['OS=="linux" and clang==1', {
'variables': {
'debug_extra_cflags': '-g0',
},
}],
], # conditions for fastbuild.
}], # fastbuild!=0
['selinux==1', {
'defines': ['CHROMIUM_SELINUX=1'],
}],
['win_use_allocator_shim==0', {
'conditions': [
['OS=="win"', {
'defines': ['NO_TCMALLOC'],
}],
],
}],
['enable_gpu==1', {
'defines': [
'ENABLE_GPU=1',
],
}],
['use_openssl==1', {
'defines': [
'USE_OPENSSL=1',
],
}],
['enable_eglimage==1', {
'defines': [
'ENABLE_EGLIMAGE=1',
],
}],
['use_skia==1', {
'defines': [
'USE_SKIA=1',
],
}],
['coverage!=0', {
'conditions': [
['OS=="mac"', {
'xcode_settings': {
'GCC_INSTRUMENT_PROGRAM_FLOW_ARCS': 'YES', # -fprofile-arcs
'GCC_GENERATE_TEST_COVERAGE_FILES': 'YES', # -ftest-coverage
},
# Add -lgcov for types executable, shared_library, and
# loadable_module; not for static_library.
# This is a delayed conditional.
'target_conditions': [
['_type!="static_library"', {
'xcode_settings': { 'OTHER_LDFLAGS': [ '-lgcov' ] },
}],
],
}],
['OS=="linux"', {
'cflags': [ '-ftest-coverage',
'-fprofile-arcs' ],
'link_settings': { 'libraries': [ '-lgcov' ] },
}],
# Finally, for Windows, we simply turn on profiling.
['OS=="win"', {
'msvs_settings': {
'VCLinkerTool': {
'Profile': 'true',
},
'VCCLCompilerTool': {
# /Z7, not /Zi, so coverage is happyb
'DebugInformationFormat': '1',
'AdditionalOptions': ['/Yd'],
}
}
}], # OS==win
], # conditions for coverage
}], # coverage!=0
['OS=="win"', {
'defines': [
'__STD_C',
'_CRT_SECURE_NO_DEPRECATE',
'_SCL_SECURE_NO_DEPRECATE',
],
'include_dirs': [
'<(DEPTH)/third_party/wtl/include',
],
}], # OS==win
['enable_register_protocol_handler==1', {
'defines': [
'ENABLE_REGISTER_PROTOCOL_HANDLER=1',
],
}],
], # conditions for 'target_defaults'
'target_conditions': [
['chromium_code==0', {
'conditions': [
[ 'os_posix==1 and OS!="mac"', {
# We don't want to get warnings from third-party code,
# so remove any existing warning-enabling flags like -Wall.
'cflags!': [
'-Wall',
'-Wextra',
'-Werror',
],
'cflags': [
# Don't warn about hash_map in third-party code.
'-Wno-deprecated',
# Don't warn about printf format problems.
# This is off by default in gcc but on in Ubuntu's gcc(!).
'-Wno-format',
],
}],
[ 'OS=="win"', {
'defines': [
'_CRT_SECURE_NO_DEPRECATE',
'_CRT_NONSTDC_NO_WARNINGS',
'_CRT_NONSTDC_NO_DEPRECATE',
'_SCL_SECURE_NO_DEPRECATE',
],
'msvs_disabled_warnings': [4800],
'msvs_settings': {
'VCCLCompilerTool': {
'WarningLevel': '3',
'WarnAsError': 'false', # TODO(maruel): Enable it.
'Detect64BitPortabilityProblems': 'false',
},
},
}],
# TODO(darin): Unfortunately, some third_party code depends on base/
[ 'OS=="win" and component=="shared_library"', {
'msvs_disabled_warnings': [
4251, # class 'std::xx' needs to have dll-interface.
],
}],
[ 'OS=="mac"', {
'xcode_settings': {
'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
},
}],
],
}, {
# In Chromium code, we define __STDC_FORMAT_MACROS in order to get the
# C99 macros on Mac and Linux.
'defines': [
'__STDC_FORMAT_MACROS',
],
'conditions': [
['OS!="win"', {
'sources/': [ ['exclude', '_win(_unittest)?\\.(h|cc)$'],
['exclude', '(^|/)win/'],
['exclude', '(^|/)win_[^/]*\\.(h|cc)$'] ],
}],
['OS!="mac"', {
'sources/': [ ['exclude', '_(cocoa|mac)(_unittest)?\\.(h|cc)$'],
['exclude', '(^|/)(cocoa|mac)/'],
['exclude', '\\.mm?$' ] ],
}],
['toolkit_uses_gtk!=1', {
'sources/': [
['exclude', '_(chromeos|gtk|x|x11|xdg)(_unittest)?\\.(h|cc)$'],
['exclude', '(^|/)gtk/'],
['exclude', '(^|/)(gtk|x11)_[^/]*\\.(h|cc)$'],
],
}],
['OS!="linux"', {
'sources/': [
['exclude', '_linux(_unittest)?\\.(h|cc)$'],
['exclude', '(^|/)linux/'],
],
}],
# We use "POSIX" to refer to all non-Windows operating systems.
['OS=="win"', {
'sources/': [ ['exclude', '_posix\\.(h|cc)$'] ],
# turn on warnings for signed/unsigned mismatch on chromium code.
'msvs_settings': {
'VCCLCompilerTool': {
'AdditionalOptions': ['/we4389'],
},
},
}],
['OS=="win" and component=="shared_library"', {
'msvs_disabled_warnings': [
4251, # class 'std::xx' needs to have dll-interface.
],
}],
['chromeos!=1', {
'sources/': [ ['exclude', '_chromeos\\.(h|cc)$'] ]
}],
['toolkit_views==0', {
'sources/': [ ['exclude', '_views\\.(h|cc)$'] ]
}],
],
}],
], # target_conditions for 'target_defaults'
'default_configuration': 'Debug',
'configurations': {
# VCLinkerTool LinkIncremental values below:
# 0 == default
# 1 == /INCREMENTAL:NO
# 2 == /INCREMENTAL
# Debug links incremental, Release does not.
#
# Abstract base configurations to cover common attributes.
#
'Common_Base': {
'abstract': 1,
'msvs_configuration_attributes': {
'OutputDirectory': '$(SolutionDir)$(ConfigurationName)',
'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
'CharacterSet': '1',
},
},
'x86_Base': {
'abstract': 1,
'msvs_settings': {
'VCLinkerTool': {
'TargetMachine': '1',
},
},
'msvs_configuration_platform': 'Win32',
},
'x64_Base': {
'abstract': 1,
'msvs_configuration_platform': 'x64',
'msvs_settings': {
'VCLinkerTool': {
'TargetMachine': '17', # x86 - 64
'AdditionalLibraryDirectories!':
['<(DEPTH)/third_party/platformsdk_win7/files/Lib'],
'AdditionalLibraryDirectories':
['<(DEPTH)/third_party/platformsdk_win7/files/Lib/x64'],
},
'VCLibrarianTool': {
'AdditionalLibraryDirectories!':
['<(DEPTH)/third_party/platformsdk_win7/files/Lib'],