Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / native_client / build / common.gypi
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 {
6   'variables': {
7     # .gyp files should set chromium_code to 1 if they build Chromium-specific
8     # code, as opposed to external code.  This variable is used to control
9     # such things as the set of warnings to enable, and whether warnings are
10     # treated as errors.
11     'chromium_code%': 0,
12
13     # Variables expected to be overriden on the GYP command line (-D) or by
14     # ~/.gyp/include.gypi.
15
16     # Override chromium_mac_pch and set it to 0 to suppress the use of
17     # precompiled headers on the Mac.  Prefix header injection may still be
18     # used, but prefix headers will not be precompiled.  This is useful when
19     # using distcc to distribute a build to compile slaves that don't
20     # share the same compiler executable as the system driving the compilation,
21     # because precompiled headers rely on pointers into a specific compiler
22     # executable's image.  Setting this to 0 is needed to use an experimental
23     # Linux-Mac cross compiler distcc farm.
24     'chromium_mac_pch%': 1,
25
26     # Enable building with ASAN (Clang's -fsanitize=address option).
27     # -fsanitize=address only works with clang, but asan=1 implies clang=1
28     # See https://sites.google.com/a/chromium.org/dev/developers/testing/addresssanitizer
29     'asan%': 0,
30
31     # Set this to true when building with Clang.
32     'clang%': 0,
33
34     # Set to 1 to enable code coverage.  In addition to build changes
35     # (e.g. extra CFLAGS), also creates a new target in the src/chrome
36     # project file called "coverage".
37     # Currently ignored on Windows.
38     'coverage%': 0,
39
40     # TODO(sgk): eliminate this if possible.
41     # It would be nicer to support this via a setting in 'target_defaults'
42     # in chrome/app/locales/locales.gypi overriding the setting in the
43     # 'Debug' configuration in the 'target_defaults' dict below,
44     # but that doesn't work as we'd like.
45     'msvs_debug_link_incremental%': '2',
46
47     # NOTE: adapted from them chrome common.gypi file for arm
48     'arm_version%': 7,
49
50     # Set Neon compilation flags (only meaningful if arm_version==7).
51     'arm_neon%': 1,
52
53     # Set Thumb compilation flags.
54     'arm_thumb%': 0,
55
56     # Set ARM fpu compilation flags (only meaningful if arm_version==7 and
57     # arm_neon==0).
58     'arm_fpu%': 'vfpv3',
59
60     # Set ARM float abi compilation flag.
61     'arm_float_abi%': 'softfp',
62
63     # Version of the mac sdk to use.
64     'mac_sdk%': '10.6',
65
66     'mac_deployment_target%': '10.6',
67
68     # NOTE: end adapted from them chrome common.gypi file for arm
69
70     # Doing this in a sub-dict so that it can be referred to below.
71     'variables': {
72       # By default we assume that we are building as part of Chrome
73       'variables': {
74         'nacl_standalone%': 0,
75
76         # Override branding to select the desired branding flavor.
77         'branding%': 'Chromium',
78
79         # Override buildtype to select the desired build flavor.
80         # Dev - everyday build for development/testing
81         # Official - release build (generally implies additional processing)
82         # TODO(mmoss) Once 'buildtype' is fully supported (e.g. Windows gyp
83         # conversion is done), some of the things which are now controlled by
84         # 'branding', such as symbol generation, will need to be refactored
85         # based on 'buildtype' (i.e. we don't care about saving symbols for
86         # non-Official builds).
87         'buildtype%': 'Dev',
88
89         'conditions': [
90           # Compute the architecture that we're building for. Default to the
91           # architecture that we're building on.
92           ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
93             # This handles the Linux platforms we generally deal with. Anything
94             # else gets passed through, which probably won't work very well;
95             # such hosts should pass an explicit target_arch to gyp.
96             #
97             # NOTE: currently only nacl is generating gyp files on an arm board.
98             #    The arm.* -> arm substitution in chrome's common.gypi isn't
99             #    appropriate in that context as we actually use target_arch==arm
100             #    to me x86 -> arm cross compile. When actually running on an arm
101             #    board, we'll generate ia32 for now, so that the generation
102             #    succeeds.
103             'target_arch%':
104               '<!(uname -m | sed -e "s/i.86/ia32/;s/x86_64/x64/;s/amd64/x64/;s/arm.*/ia32/")'
105           }, {  # OS!="linux"
106             'target_arch%': 'ia32',
107           }],
108         ]
109       },
110       # These come from the above variable scope.
111       'nacl_standalone%': '<(nacl_standalone)',
112       'target_arch%': '<(target_arch)',
113       'branding%': '<(branding)',
114       'buildtype%': '<(buildtype)',
115
116       'conditions': [
117         # The system root for cross-compiles. Default: none.
118         # If we are building in chrome we want to rely on chrome's default, which
119         # means we can't set a default here.
120         ['nacl_standalone!=0', {
121           'sysroot%': '',
122         }],
123       ],
124
125       # This variable is to allow us to build components as either static
126       # libraries or dynamic shared libraries.
127       'component%': 'static_library',
128     },
129     # These come from the above variable scope.
130     'target_arch%': '<(target_arch)',
131     'sysroot%': '<(sysroot)',
132     'nacl_standalone%': '<(nacl_standalone)',
133     'branding%': '<(branding)',
134     'buildtype%': '<(buildtype)',
135     'component%': '<(component)',
136
137     'nacl_strict_warnings%': 1,
138     'nacl_validator_ragel%': 1,
139
140     'linux2%': 0,
141   },
142
143   'target_defaults': {
144     'include_dirs': [
145       # Putting this first so that people who include "ppapi/..." get the
146       # third_party version instead of any other version (the chrome location
147       # for instance).
148       '../src/third_party',
149       '../..',
150     ],
151     'variables': {
152       'win_target': 'x32',
153     },
154     'target_conditions': [
155       ['win_target=="x64"', {
156         'target_arch': 'x64',
157         'defines!': [
158           'NACL_TARGET_SUBARCH=32',
159           'NACL_BUILD_SUBARCH=32',
160         ],
161         'defines': [
162           'NACL_TARGET_SUBARCH=64',
163           'NACL_BUILD_SUBARCH=64',
164         ],
165         'configurations': {
166           'Common_Base': {
167             'msvs_target_platform': 'x64',
168           },
169         },
170       }],
171     ],
172     'conditions': [
173       # TODO(gregoryd): split target and build subarchs
174       ['target_arch=="ia32"', {
175         'defines': [
176           'NACL_TARGET_SUBARCH=32',
177           'NACL_TARGET_ARCH=x86',
178           'NACL_BUILD_SUBARCH=32',
179           'NACL_BUILD_ARCH=x86',
180         ],
181       }],
182       ['target_arch=="x64"', {
183         'defines': [
184           'NACL_TARGET_SUBARCH=64',
185           'NACL_TARGET_ARCH=x86',
186           'NACL_BUILD_SUBARCH=64',
187           'NACL_BUILD_ARCH=x86',
188         ],
189       }],
190       ['target_arch=="arm"', {
191         'defines': [
192           'NACL_BUILD_ARCH=arm',
193           'NACL_BUILD_SUBARCH=32',
194           'NACL_TARGET_ARCH=arm',
195           'NACL_TARGET_SUBARCH=32',
196         ],
197       }],
198       ['target_arch=="mipsel"', {
199         'defines': [
200           'NACL_BUILD_ARCH=mips',
201           'NACL_BUILD_SUBARCH=32',
202           'NACL_TARGET_ARCH=mips',
203           'NACL_TARGET_SUBARCH=32',
204         ],
205       }],
206       ['linux2==1', {
207         'defines': ['LINUX2=1'],
208       }],
209       ['OS=="win"', {
210         'defines': [ 'NOMINMAX' ]
211       }],
212       ['coverage!=0', {
213         'conditions': [
214           ['OS=="mac"', {
215             'xcode_settings': {
216               'GCC_INSTRUMENT_PROGRAM_FLOW_ARCS': 'YES',
217               'GCC_GENERATE_TEST_COVERAGE_FILES': 'YES',
218             },
219             # Add -lgcov for executables, not for static_libraries.
220             # This is a delayed conditional.
221             'target_conditions': [
222               ['_type=="executable"', {
223                 'xcode_settings': { 'OTHER_LDFLAGS': [ '-lgcov' ] },
224               }],
225             ],
226           }],
227           # Linux gyp (into scons) doesn't like target_conditions?
228           # TODO(???): track down why 'target_conditions' doesn't work
229           # on Linux gyp into scons like it does on Mac gyp into xcodeproj.
230           ['OS=="linux"', {
231             'cflags': [ '-ftest-coverage',
232                         '-fprofile-arcs'],
233             'link_settings': { 'libraries': [ '-lgcov' ] },
234           }],
235         ],
236       # TODO(jrg): options for code coverage on Windows
237       }],
238       ['clang==1', {
239         'cflags': [
240           '-Wheader-hygiene',
241           # Clang spots more unused functions.
242           '-Wno-unused-function',
243           # Don't die on dtoa code that uses a char as an array index.
244           '-Wno-char-subscripts',
245           # Especially needed for gtest macros using enum values from Mac
246           # system headers.
247           # TODO(pkasting): In C++11 this is legal, so this should be
248           # removed when we change to that.  (This is also why we don't
249           # bother fixing all these cases today.)
250           '-Wno-unnamed-type-template-args',
251           # Allow 'default' label in switch even when all enumeration
252           # cases have been covered.
253           '-Wno-covered-switch-default',
254           # Allow C++11 extensions (for "override")
255           '-Wno-c++11-extensions',
256         ],
257         'cflags!': [
258           # Clang doesn't seem to know know this flag.
259           '-mfpmath=sse',
260         ],
261       }],
262     ],
263   },
264   'conditions': [
265     ['OS=="linux"', {
266       'target_defaults': {
267         # Enable -Werror by default, but put it in a variable so it can
268         # be disabled in ~/.gyp/include.gypi on the valgrind builders.
269         'variables': {
270           'werror%': '-Werror',
271         },
272         'cflags': [
273            '<(werror)',  # See note above about the werror variable.
274            '-pthread',
275           '-fno-exceptions',
276           '-Wall', # TODO(bradnelson): why does this disappear?!?
277         ],
278         'conditions': [
279           ['nacl_standalone==1 and OS=="linux"', {
280             'cflags': ['-fPIC'],
281           }],
282           ['nacl_standalone==1 and nacl_strict_warnings==1', {
283             # TODO(gregoryd): remove the condition when the issues in
284             # Chrome code are fixed.
285             'cflags': [
286               # TODO(bradnelson): This was being masked by key naming
287               # collisions. Track down the items blocking enabling this.
288               #'-pedantic',
289               '-Wextra',
290               '-Wno-long-long',
291               '-Wswitch-enum',
292               '-Wsign-compare',
293               '-Wundef',
294               '-fdiagnostics-show-option',
295             ],
296             'cflags_c': [
297               # Require defining functions as "foo(void)" rather than
298               # "foo()" because, in C (but not C++), the latter
299               # defines a function with unspecified arguments rather
300               # than no arguments.
301               '-Wstrict-prototypes',
302             ],
303           }],
304           ['target_arch=="arm"', {
305             'target_conditions': [
306               ['_toolset=="target"', {
307                 'cflags': [
308                   '-Wno-abi',
309                   '-fno-exceptions',
310                   '-Wall',
311                   '-fPIC',
312                   '--sysroot=<(sysroot)',
313                 ],
314                 'ldflags': [
315                   '--sysroot=<(sysroot)',
316                 ],
317                 # TODO(mcgrathr): This is copied from the arm section of
318                 # chromium/src/build/common.gypi, but these details really
319                 # should be more fully harmonized and shared.
320                 'conditions': [
321                   ['arm_thumb==1', {
322                     'cflags': [
323                       '-mthumb',
324                     ]
325                   }],
326                   ['arm_version==7', {
327                     'cflags': [
328                     '-march=armv7-a',
329                     '-mtune=cortex-a9',
330                     '-mfloat-abi=<(arm_float_abi)',
331                     ],
332                     'conditions': [
333                       ['arm_neon==1', {
334                         'cflags': [ '-mfpu=neon', ],
335                       }, {
336                         'cflags': [ '-mfpu=<(arm_fpu)', ],
337                       }]
338                     ],
339                   }],
340                 ],
341               }],
342             ],
343           }],
344           ['target_arch=="mipsel"', {
345             'target_conditions': [
346               ['_toolset=="target"', {
347                 # Copied from chromium build/common.gypi
348                 'conditions': [
349                   ['mips_arch_variant=="mips32r2"', {
350                     'cflags': ['-mips32r2'],
351                   }, {
352                     'cflags': ['-mips32'],
353                   }],
354                 ],
355               }],
356             ],
357           }],
358           ['target_arch=="ia32" or target_arch=="x64"', {
359             'conditions': [
360               ['target_arch=="x64"', {
361                 'variables': {
362                   'mbits_flag': '-m64',
363                 },
364               }, {
365                 'variables': {
366                   'mbits_flag': '-m32',
367                 }
368               },],
369             ],
370             'asflags': [
371               '<(mbits_flag)',
372             ],
373             'cflags': [
374               '<(mbits_flag)',
375               '-fno-exceptions',
376               '-Wall',
377             ],
378             'ldflags': [
379               '<(mbits_flag)',
380             ],
381           }],
382         ],
383         'cflags_cc': [
384           '-fno-rtti',
385           '-fno-threadsafe-statics',
386         ],
387         'ldflags': [
388           '-pthread',
389           '-Wl,-z,noexecstack',
390         ],
391         'defines': [
392           'NACL_LINUX=1',
393           'NACL_ANDROID=0',
394           'NACL_OSX=0',
395           'NACL_WINDOWS=0',
396           '_BSD_SOURCE=1',
397           '_POSIX_C_SOURCE=199506',
398           '_XOPEN_SOURCE=600',
399           '_GNU_SOURCE=1',
400           '__STDC_LIMIT_MACROS=1',
401         ],
402         'link_settings': {
403           'libraries': [
404             '-lrt',
405             '-lpthread',
406           ],
407         },
408         'configurations': {
409           'Debug': {
410             'variables': {
411               'debug_optimize%': '0',
412             },
413             'defines': [
414               '_DEBUG',
415             ],
416             'cflags': [
417               '-O<(debug_optimize)',
418               '-g',
419               # One can use '-gstabs' to enable building the debugging
420               # information in STABS format for breakpad's dumpsyms.
421             ],
422             'ldflags': [
423               '-rdynamic',  # Allows backtrace to resolve symbols.
424             ],
425           },
426           'Release': {
427             'variables': {
428               'release_optimize%': '2',
429             },
430             'cflags': [
431               '-O<(release_optimize)',
432               # Don't emit the GCC version ident directives, they just end up
433               # in the .comment section taking up binary size.
434               '-fno-ident',
435               # Put data and code in their own sections, so that unused symbols
436               # can be removed at link time with --gc-sections.
437               '-fdata-sections',
438               '-ffunction-sections',
439             ],
440             'conditions': [
441               ['clang==1', {
442                 'cflags!': [
443                   '-fno-ident',
444                 ],
445               }],
446             ],
447           },
448         },
449       },
450     }],
451     ['OS=="mac"', {
452       'target_defaults': {
453         'variables': {
454           # This should be 'mac_real_dsym%', but there seems to be a bug
455           # with % in variables that are intended to be set to different
456           # values in different targets, like this one.
457           'mac_real_dsym': 0,  # Fake .dSYMs are fine in most cases.
458         },
459         'mac_bundle': 0,
460         'xcode_settings': {
461           'ALWAYS_SEARCH_USER_PATHS': 'NO',
462           'GCC_C_LANGUAGE_STANDARD': 'gnu99',
463           'GCC_CW_ASM_SYNTAX': 'NO',                # No -fasm-blocks
464           'GCC_DYNAMIC_NO_PIC': 'NO',               # No -mdynamic-no-pic
465                                                     # (Equivalent to -fPIC)
466           'GCC_ENABLE_CPP_EXCEPTIONS': 'NO',        # -fno-exceptions
467           'GCC_ENABLE_CPP_RTTI': 'NO',              # -fno-rtti
468           'GCC_ENABLE_PASCAL_STRINGS': 'NO',        # No -mpascal-strings
469           'GCC_INLINES_ARE_PRIVATE_EXTERN':
470             'YES',  # -fvisibility-inlines-hidden
471           'GCC_OBJC_CALL_CXX_CDTORS': 'YES',        # -fobjc-call-cxx-cdtors
472           'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES',      # -fvisibility=hidden
473           'GCC_THREADSAFE_STATICS': 'NO',           # -fno-threadsafe-statics
474           'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES',    # -Werror
475           # Don't set GCC_VERSION so that we default to /usr/bin/gcc
476           #'GCC_VERSION': '4.2',
477           'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES',  # -Wnewline-eof
478           'PREBINDING': 'NO',                       # No -Wl,-prebind
479           'USE_HEADERMAP': 'NO',
480           # TODO(bradnelson): -Werror ?!?
481           'WARNING_CFLAGS': ['-Wall', '-Wendif-labels', '-Wno-long-long'],
482           'conditions': [
483             ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
484                                  {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}],
485             ['clang==1', {
486               'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
487               'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
488               'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
489               'WARNING_CFLAGS': [
490                 '-Wheader-hygiene',
491                 # Don't die on dtoa code that uses a char as an array index.
492                 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
493                 '-Wno-char-subscripts',
494                 # Clang spots more unused functions.
495                 '-Wno-unused-function',
496                 # See comments on this flag higher up in this file.
497                 '-Wno-unnamed-type-template-args',
498                 # Allow 'default' label in switch even when all enumeration
499                 # cases have been covered.
500                 '-Wno-covered-switch-default',
501                 # Allow C++11 extensions (for "override")
502                 '-Wno-c++11-extensions',
503                 # TODO(thakis): Reenable once the one instance this warns on
504                 # is fixed.
505                 '-Wno-parentheses',
506               ],
507             }],
508             ['nacl_standalone==1', {
509               # If part of the Chromium build, use the Chromium default.
510               # Otherwise, when building standalone, use this.
511               'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)', # -mmacosx-version-min
512               'SDKROOT': 'macosx<(mac_sdk)',            # -isysroot
513             }],
514           ],
515         },
516         'conditions': [
517           ['clang==1', {
518             'variables': {
519               'clang_dir':
520                 '<(DEPTH)/third_party/llvm-build/Release+Asserts/bin',
521             },
522           }],
523           ['nacl_standalone==1 and nacl_strict_warnings==1', {
524             'xcode_settings': {
525               # TODO(gregoryd): remove the condition when the issues in
526               # Chrome code are fixed.
527               'WARNING_CFLAGS': [
528                 '-pedantic',
529                 '-Wextra',
530                 '-Wno-long-long',
531                 '-Wswitch-enum',
532                 '-Wsign-compare',
533                 '-Wundef',
534                 '-fdiagnostics-show-option',
535               ],
536             },
537           }],
538           ['nacl_standalone==1 and target_arch=="x64"', {
539             'xcode_settings': {'ARCHS': ['x86_64']},
540           }],
541           ['nacl_standalone==1', {
542             'target_conditions': [
543               ['_type!="static_library"', {
544                 'xcode_settings': {
545                   'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
546               }],
547               ['_mac_bundle', {
548                 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
549               }],
550               ['_type=="executable"', {
551                 'target_conditions': [
552                   ['mac_real_dsym == 1', {
553                     # To get a real .dSYM bundle produced by dsymutil, set the
554                     # debug information format to dwarf-with-dsym.  Since
555                     # strip_from_xcode will not be used, set Xcode to do the
556                     # stripping as well.
557                     'configurations': {
558                       'Release': {
559                         'xcode_settings': {
560                           'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
561                           'DEPLOYMENT_POSTPROCESSING': 'YES',
562                           'STRIP_INSTALLED_PRODUCT': 'YES',
563                         },
564                       },
565                     },
566                   }, {  # mac_real_dsym != 1
567                     # To get a fast fake .dSYM bundle, use a post-build step to
568                     # produce the .dSYM and strip the executable.  strip_from_xcode
569                     # only operates in the Release configuration.
570                     'postbuilds': [
571                       {
572                         'variables': {
573                           # Define strip_from_xcode in a variable ending in _path
574                           # so that gyp understands it's a path and performs proper
575                           # relativization during dict merging.
576                           'strip_from_xcode_path':
577                               'mac/strip_from_xcode',
578                         },
579                         'postbuild_name': 'Strip If Needed',
580                         'action': ['<(strip_from_xcode_path)'],
581                       },
582                     ],
583                   }],
584                 ],
585               }],
586             ],
587           }],
588         ],
589         'defines': [
590           'NACL_LINUX=0',
591           'NACL_ANDROID=0',
592           'NACL_OSX=1',
593           'NACL_WINDOWS=0',
594         ],
595       },
596     }],
597     ['OS=="win"', {
598       'target_defaults': {
599         'variables': {
600           'windows_asm_rule%': 1,
601         },
602         'target_conditions': [
603           ['windows_asm_rule==1', {
604             'rules': [
605               {
606                 'rule_name': 'assembler (gnu-compatible)',
607                 'msvs_cygwin_shell': 0,
608                 'msvs_quote_cmd': 0,
609                 'extension': 'S',
610                 'inputs': [
611                   '<(DEPTH)/native_client/tools/win_as.py',
612                   '$(InputPath)'
613                 ],
614                 'outputs': [
615                   '$(IntDir)/$(InputName).obj',
616                 ],
617                 'action': [
618                    'python',
619                    '<(DEPTH)/native_client/tools/win_as.py',
620                    # target architecture: Win32 or x64
621                    '-a', '$(PlatformName)',
622                    # output path
623                    '-o', '$(IntDir)/$(InputName).obj',
624                    # path to top of tree, e.g. svn/nacl
625                    '-p', '<(DEPTH)',
626                    # .S file
627                   '$(InputPath)'
628                 ],
629                 'message': 'Building assembly language file $(InputPath)',
630                 'process_outputs_as_sources': 1,
631               },
632             ],
633           }],
634         ],
635         'defines': [
636           '_WIN32_WINNT=0x0600',
637           'WINVER=0x0600',
638           # WIN32 is used by ppapi
639           'WIN32',
640           'NOMINMAX',
641           '_CRT_RAND_S',
642           'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
643           # WIN32_LEAN_AND_MEAN tells windows.h to omit obsolete and rarely
644           # used #include files. This allows use of Winsock 2.0 which otherwise
645           # would conflict with Winsock 1.x included by windows.h.
646           'WIN32_LEAN_AND_MEAN',
647           '_SECURE_ATL',
648           '__STDC_LIMIT_MACROS=1',
649
650           'NACL_LINUX=0',
651           'NACL_ANDROID=0',
652           'NACL_OSX=0',
653           'NACL_WINDOWS=1'
654         ],
655         'conditions': [
656           ['component=="static_library"', {
657             'defines': [
658               '_HAS_EXCEPTIONS=0',
659             ],
660           }],
661           ['MSVS_VERSION=="2008"', {
662             'defines': [
663               '_HAS_TR1=0',
664             ],
665           }],
666         ],
667         'msvs_cygwin_dirs': ['../third_party/cygwin'],
668         # TODO(bsy) remove 4355 once cross-repo
669         # NACL_ALLOW_THIS_IN_INITIALIZER_LIST changes go in.
670         'msvs_disabled_warnings': [4355, 4396, 4503, 4800, 4819],
671         'msvs_settings': {
672           'VCCLCompilerTool': {
673             'MinimalRebuild': 'false',
674             'BufferSecurityCheck': 'true',
675             'EnableFunctionLevelLinking': 'true',
676             'RuntimeTypeInfo': 'false',
677             'WarningLevel': '3',
678             'WarnAsError': 'true',
679             'DebugInformationFormat': '3',
680
681             'conditions': [
682               ['component=="shared_library"', {
683                 'ExceptionHandling': '1',  # /EHsc
684               }, {
685                 'ExceptionHandling': '0',
686               }],
687             ],
688           },
689           'VCLibrarianTool': {
690             'AdditionalOptions': ['/ignore:4221'],
691           },
692           'VCLinkerTool': {
693             'AdditionalOptions': [
694               '/safeseh:NO',
695               '/dynamicbase:NO',
696               '/ignore:4199',
697               '/ignore:4221',
698               '/nxcompat',
699             ],
700             'AdditionalDependencies': [
701               'wininet.lib',
702               'version.lib',
703               'msimg32.lib',
704               'ws2_32.lib',
705               'usp10.lib',
706               'psapi.lib',
707               'dbghelp.lib',
708             ],
709             'DelayLoadDLLs': [
710               'dbghelp.dll',
711               'dwmapi.dll',
712               'uxtheme.dll',
713             ],
714             'GenerateDebugInformation': 'true',
715             'MapFileName': '$(OutDir)\\$(TargetName).map',
716             'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
717             'TargetMachine': '1',
718             'FixedBaseAddress': '1',
719             # SubSystem values:
720             #   0 == not set
721             #   1 == /SUBSYSTEM:CONSOLE
722             #   2 == /SUBSYSTEM:WINDOWS
723             # Most of the executables we'll ever create are tests
724             # and utilities with console output.
725             'SubSystem': '1',
726           },
727           'VCMIDLTool': {
728             'GenerateStublessProxies': 'true',
729             'TypeLibraryName': '$(InputName).tlb',
730             'OutputDirectory': '$(IntDir)',
731             'HeaderFileName': '$(InputName).h',
732             'DLLDataFileName': 'dlldata.c',
733             'InterfaceIdentifierFileName': '$(InputName)_i.c',
734             'ProxyFileName': '$(InputName)_p.c',
735           },
736           'VCResourceCompilerTool': {
737             'Culture' : '1033',
738             'AdditionalIncludeDirectories': ['<(DEPTH)'],
739           },
740         },
741       },
742     }],
743     ['chromium_code==0 and nacl_standalone==0', {
744       # This section must follow the other conditon sections above because
745       # external_code.gypi expects to be merged into those settings.
746       'includes': [
747         'external_code.gypi',
748       ],
749     }, {
750       'target_defaults': {
751         # In Chromium code, we define __STDC_FORMAT_MACROS in order to get the
752         # C99 macros on Mac and Linux.
753         'defines': [
754           '__STDC_FORMAT_MACROS',
755         ],
756         'msvs_settings': {
757           'VCCLCompilerTool': {
758             'Detect64BitPortabilityProblems': 'false',
759             # TODO(new_hire): above line should go away
760           },
761         },
762       },
763     }],
764     ['clang==1 and nacl_standalone==1', {
765       'make_global_settings': [
766         ['CC', 'third_party/llvm-build/Release+Asserts/bin/clang'],
767         ['CXX', 'third_party/llvm-build/Release+Asserts/bin/clang++'],
768         ['LINK', '$(CXX)'],
769         ['CC.host', '$(CC)'],
770         ['CXX.host', '$(CXX)'],
771         ['LINK.host', '$(LINK)'],
772       ],
773     }],
774   ],
775   'xcode_settings': {
776     # The Xcode generator will look for an xcode_settings section at the root
777     # of each dict and use it to apply settings on a file-wide basis.  Most
778     # settings should not be here, they should be in target-specific
779     # xcode_settings sections, or better yet, should use non-Xcode-specific
780     # settings in target dicts.  SYMROOT is a special case, because many other
781     # Xcode variables depend on it, including variables such as
782     # PROJECT_DERIVED_FILE_DIR.  When a source group corresponding to something
783     # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
784     # files to appear (when present) in the UI as actual files and not red
785     # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
786     # and therefore SYMROOT, needs to be set at the project level.
787     'SYMROOT': '<(DEPTH)/xcodebuild',
788   },
789   'includes': [
790     'untrusted.gypi',
791   ],
792 }