d53c6e6bffb182696eda85c1361b84edcf55359d
[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               'cflags': [
306                   '-Wno-abi',
307                   '-fno-exceptions',
308                   '-Wall',
309                   '-fPIC',
310                   '--sysroot=<(sysroot)',
311               ],
312               'ldflags': [
313                   '--sysroot=<(sysroot)',
314               ],
315               # TODO(mcgrathr): This is copied from the arm section of
316               # chromium/src/build/common.gypi, but these details really
317               # should be more fully harmonized and shared.
318               'conditions': [
319                   ['arm_thumb==1', {
320                       'cflags': [
321                           '-mthumb',
322                       ]
323                   }],
324                   ['arm_version==7', {
325                       'cflags': [
326                           '-march=armv7-a',
327                           '-mtune=cortex-a9',
328                           '-mfloat-abi=<(arm_float_abi)',
329                       ],
330                       'conditions': [
331                           ['arm_neon==1', {
332                               'cflags': [ '-mfpu=neon', ],
333                           }, {
334                               'cflags': [ '-mfpu=<(arm_fpu)', ],
335                           }]
336                       ],
337                   }],
338               ],
339             }],
340             ['target_arch=="mipsel"', {
341               # Copied from chromium build/common.gypi
342               'conditions': [
343                 ['mips_arch_variant=="mips32r2"', {
344                   'cflags': ['-mips32r2'],
345                 }, {
346                   'cflags': ['-mips32'],
347                 }],
348               ],
349             }],
350             ['target_arch=="ia32" or target_arch=="x64"', {
351               'conditions': [
352                 ['target_arch=="x64"', {
353                   'variables': {
354                     'mbits_flag': '-m64',
355                   },
356                 }, {
357                   'variables': {
358                     'mbits_flag': '-m32',
359                   }
360                 },],
361               ],
362               'asflags': [
363                 '<(mbits_flag)',
364               ],
365               'cflags': [
366                 '<(mbits_flag)',
367                 '-fno-exceptions',
368                 '-Wall',
369               ],
370               'ldflags': [
371                 '<(mbits_flag)',
372               ],
373           }],
374         ],
375         'cflags_cc': [
376           '-fno-rtti',
377           '-fno-threadsafe-statics',
378         ],
379         'ldflags': [
380           '-pthread',
381           '-Wl,-z,noexecstack',
382         ],
383         'defines': [
384           'NACL_LINUX=1',
385           'NACL_ANDROID=0',
386           'NACL_OSX=0',
387           'NACL_WINDOWS=0',
388           '_BSD_SOURCE=1',
389           '_POSIX_C_SOURCE=199506',
390           '_XOPEN_SOURCE=600',
391           '_GNU_SOURCE=1',
392           '__STDC_LIMIT_MACROS=1',
393         ],
394         'link_settings': {
395           'libraries': [
396             '-lrt',
397             '-lpthread',
398           ],
399         },
400         'configurations': {
401           'Debug': {
402             'variables': {
403               'debug_optimize%': '0',
404             },
405             'defines': [
406               '_DEBUG',
407             ],
408             'cflags': [
409               '-O<(debug_optimize)',
410               '-g',
411               # One can use '-gstabs' to enable building the debugging
412               # information in STABS format for breakpad's dumpsyms.
413             ],
414             'ldflags': [
415               '-rdynamic',  # Allows backtrace to resolve symbols.
416             ],
417           },
418           'Release': {
419             'variables': {
420               'release_optimize%': '2',
421             },
422             'cflags': [
423               '-O<(release_optimize)',
424               # Don't emit the GCC version ident directives, they just end up
425               # in the .comment section taking up binary size.
426               '-fno-ident',
427               # Put data and code in their own sections, so that unused symbols
428               # can be removed at link time with --gc-sections.
429               '-fdata-sections',
430               '-ffunction-sections',
431             ],
432             'conditions': [
433               ['clang==1', {
434                 'cflags!': [
435                   '-fno-ident',
436                 ],
437               }],
438             ],
439           },
440         },
441       },
442     }],
443     ['OS=="mac"', {
444       'target_defaults': {
445         'variables': {
446           # This should be 'mac_real_dsym%', but there seems to be a bug
447           # with % in variables that are intended to be set to different
448           # values in different targets, like this one.
449           'mac_real_dsym': 0,  # Fake .dSYMs are fine in most cases.
450         },
451         'mac_bundle': 0,
452         'xcode_settings': {
453           'ALWAYS_SEARCH_USER_PATHS': 'NO',
454           'GCC_C_LANGUAGE_STANDARD': 'gnu99',
455           'GCC_CW_ASM_SYNTAX': 'NO',                # No -fasm-blocks
456           'GCC_DYNAMIC_NO_PIC': 'NO',               # No -mdynamic-no-pic
457                                                     # (Equivalent to -fPIC)
458           'GCC_ENABLE_CPP_EXCEPTIONS': 'NO',        # -fno-exceptions
459           'GCC_ENABLE_CPP_RTTI': 'NO',              # -fno-rtti
460           'GCC_ENABLE_PASCAL_STRINGS': 'NO',        # No -mpascal-strings
461           'GCC_INLINES_ARE_PRIVATE_EXTERN':
462             'YES',  # -fvisibility-inlines-hidden
463           'GCC_OBJC_CALL_CXX_CDTORS': 'YES',        # -fobjc-call-cxx-cdtors
464           'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES',      # -fvisibility=hidden
465           'GCC_THREADSAFE_STATICS': 'NO',           # -fno-threadsafe-statics
466           'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES',    # -Werror
467           # Don't set GCC_VERSION so that we default to /usr/bin/gcc
468           #'GCC_VERSION': '4.2',
469           'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES',  # -Wnewline-eof
470           'PREBINDING': 'NO',                       # No -Wl,-prebind
471           'USE_HEADERMAP': 'NO',
472           # TODO(bradnelson): -Werror ?!?
473           'WARNING_CFLAGS': ['-Wall', '-Wendif-labels', '-Wno-long-long'],
474           'conditions': [
475             ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
476                                  {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}],
477             ['clang==1', {
478               'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
479               'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
480               'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
481               'WARNING_CFLAGS': [
482                 '-Wheader-hygiene',
483                 # Don't die on dtoa code that uses a char as an array index.
484                 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
485                 '-Wno-char-subscripts',
486                 # Clang spots more unused functions.
487                 '-Wno-unused-function',
488                 # See comments on this flag higher up in this file.
489                 '-Wno-unnamed-type-template-args',
490                 # Allow 'default' label in switch even when all enumeration
491                 # cases have been covered.
492                 '-Wno-covered-switch-default',
493                 # Allow C++11 extensions (for "override")
494                 '-Wno-c++11-extensions',
495                 # TODO(thakis): Reenable once the one instance this warns on
496                 # is fixed.
497                 '-Wno-parentheses',
498               ],
499             }],
500             ['nacl_standalone==1', {
501               # If part of the Chromium build, use the Chromium default.
502               # Otherwise, when building standalone, use this.
503               'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)', # -mmacosx-version-min
504               'SDKROOT': 'macosx<(mac_sdk)',            # -isysroot
505             }],
506           ],
507         },
508         'conditions': [
509           ['clang==1', {
510             'variables': {
511               'clang_dir':
512                 '<(DEPTH)/third_party/llvm-build/Release+Asserts/bin',
513             },
514           }],
515           ['nacl_standalone==1 and nacl_strict_warnings==1', {
516             'xcode_settings': {
517               # TODO(gregoryd): remove the condition when the issues in
518               # Chrome code are fixed.
519               'WARNING_CFLAGS': [
520                 '-pedantic',
521                 '-Wextra',
522                 '-Wno-long-long',
523                 '-Wswitch-enum',
524                 '-Wsign-compare',
525                 '-Wundef',
526                 '-fdiagnostics-show-option',
527               ],
528             },
529           }],
530           ['nacl_standalone==1 and target_arch=="x64"', {
531             'xcode_settings': {'ARCHS': ['x86_64']},
532           }],
533           ['nacl_standalone==1', {
534             'target_conditions': [
535               ['_type!="static_library"', {
536                 'xcode_settings': {
537                   'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
538               }],
539               ['_mac_bundle', {
540                 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
541               }],
542               ['_type=="executable"', {
543                 'target_conditions': [
544                   ['mac_real_dsym == 1', {
545                     # To get a real .dSYM bundle produced by dsymutil, set the
546                     # debug information format to dwarf-with-dsym.  Since
547                     # strip_from_xcode will not be used, set Xcode to do the
548                     # stripping as well.
549                     'configurations': {
550                       'Release': {
551                         'xcode_settings': {
552                           'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
553                           'DEPLOYMENT_POSTPROCESSING': 'YES',
554                           'STRIP_INSTALLED_PRODUCT': 'YES',
555                         },
556                       },
557                     },
558                   }, {  # mac_real_dsym != 1
559                     # To get a fast fake .dSYM bundle, use a post-build step to
560                     # produce the .dSYM and strip the executable.  strip_from_xcode
561                     # only operates in the Release configuration.
562                     'postbuilds': [
563                       {
564                         'variables': {
565                           # Define strip_from_xcode in a variable ending in _path
566                           # so that gyp understands it's a path and performs proper
567                           # relativization during dict merging.
568                           'strip_from_xcode_path':
569                               'mac/strip_from_xcode',
570                         },
571                         'postbuild_name': 'Strip If Needed',
572                         'action': ['<(strip_from_xcode_path)'],
573                       },
574                     ],
575                   }],
576                 ],
577               }],
578             ],
579           }],
580         ],
581         'defines': [
582           'NACL_LINUX=0',
583           'NACL_ANDROID=0',
584           'NACL_OSX=1',
585           'NACL_WINDOWS=0',
586         ],
587       },
588     }],
589     ['OS=="win"', {
590       'target_defaults': {
591         'variables': {
592           'windows_asm_rule%': 1,
593         },
594         'target_conditions': [
595           ['windows_asm_rule==1', {
596             'rules': [
597               {
598                 'rule_name': 'assembler (gnu-compatible)',
599                 'msvs_cygwin_shell': 0,
600                 'msvs_quote_cmd': 0,
601                 'extension': 'S',
602                 'inputs': [
603                   '<(DEPTH)/native_client/tools/win_as.py',
604                   '$(InputPath)'
605                 ],
606                 'outputs': [
607                   '$(IntDir)/$(InputName).obj',
608                 ],
609                 'action': [
610                    'python',
611                    '<(DEPTH)/native_client/tools/win_as.py',
612                    # target architecture: Win32 or x64
613                    '-a', '$(PlatformName)',
614                    # output path
615                    '-o', '$(IntDir)/$(InputName).obj',
616                    # path to top of tree, e.g. svn/nacl
617                    '-p', '<(DEPTH)',
618                    # .S file
619                   '$(InputPath)'
620                 ],
621                 'message': 'Building assembly language file $(InputPath)',
622                 'process_outputs_as_sources': 1,
623               },
624             ],
625           }],
626         ],
627         'defines': [
628           '_WIN32_WINNT=0x0600',
629           'WINVER=0x0600',
630           # WIN32 is used by ppapi
631           'WIN32',
632           'NOMINMAX',
633           '_CRT_RAND_S',
634           'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
635           # WIN32_LEAN_AND_MEAN tells windows.h to omit obsolete and rarely
636           # used #include files. This allows use of Winsock 2.0 which otherwise
637           # would conflict with Winsock 1.x included by windows.h.
638           'WIN32_LEAN_AND_MEAN',
639           '_SECURE_ATL',
640           '__STDC_LIMIT_MACROS=1',
641
642           'NACL_LINUX=0',
643           'NACL_ANDROID=0',
644           'NACL_OSX=0',
645           'NACL_WINDOWS=1'
646         ],
647         'conditions': [
648           ['component=="static_library"', {
649             'defines': [
650               '_HAS_EXCEPTIONS=0',
651             ],
652           }],
653           ['MSVS_VERSION=="2008"', {
654             'defines': [
655               '_HAS_TR1=0',
656             ],
657           }],
658         ],
659         'msvs_cygwin_dirs': ['../third_party/cygwin'],
660         # TODO(bsy) remove 4355 once cross-repo
661         # NACL_ALLOW_THIS_IN_INITIALIZER_LIST changes go in.
662         'msvs_disabled_warnings': [4355, 4396, 4503, 4800, 4819],
663         'msvs_settings': {
664           'VCCLCompilerTool': {
665             'MinimalRebuild': 'false',
666             'BufferSecurityCheck': 'true',
667             'EnableFunctionLevelLinking': 'true',
668             'RuntimeTypeInfo': 'false',
669             'WarningLevel': '3',
670             'WarnAsError': 'true',
671             'DebugInformationFormat': '3',
672
673             'conditions': [
674               ['component=="shared_library"', {
675                 'ExceptionHandling': '1',  # /EHsc
676               }, {
677                 'ExceptionHandling': '0',
678               }],
679             ],
680           },
681           'VCLibrarianTool': {
682             'AdditionalOptions': ['/ignore:4221'],
683           },
684           'VCLinkerTool': {
685             'AdditionalOptions': [
686               '/safeseh:NO',
687               '/dynamicbase:NO',
688               '/ignore:4199',
689               '/ignore:4221',
690               '/nxcompat',
691             ],
692             'AdditionalDependencies': [
693               'wininet.lib',
694               'version.lib',
695               'msimg32.lib',
696               'ws2_32.lib',
697               'usp10.lib',
698               'psapi.lib',
699               'dbghelp.lib',
700             ],
701             'DelayLoadDLLs': [
702               'dbghelp.dll',
703               'dwmapi.dll',
704               'uxtheme.dll',
705             ],
706             'GenerateDebugInformation': 'true',
707             'MapFileName': '$(OutDir)\\$(TargetName).map',
708             'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
709             'TargetMachine': '1',
710             'FixedBaseAddress': '1',
711             # SubSystem values:
712             #   0 == not set
713             #   1 == /SUBSYSTEM:CONSOLE
714             #   2 == /SUBSYSTEM:WINDOWS
715             # Most of the executables we'll ever create are tests
716             # and utilities with console output.
717             'SubSystem': '1',
718           },
719           'VCMIDLTool': {
720             'GenerateStublessProxies': 'true',
721             'TypeLibraryName': '$(InputName).tlb',
722             'OutputDirectory': '$(IntDir)',
723             'HeaderFileName': '$(InputName).h',
724             'DLLDataFileName': 'dlldata.c',
725             'InterfaceIdentifierFileName': '$(InputName)_i.c',
726             'ProxyFileName': '$(InputName)_p.c',
727           },
728           'VCResourceCompilerTool': {
729             'Culture' : '1033',
730             'AdditionalIncludeDirectories': ['<(DEPTH)'],
731           },
732         },
733       },
734     }],
735     ['chromium_code==0 and nacl_standalone==0', {
736       # This section must follow the other conditon sections above because
737       # external_code.gypi expects to be merged into those settings.
738       'includes': [
739         'external_code.gypi',
740       ],
741     }, {
742       'target_defaults': {
743         # In Chromium code, we define __STDC_FORMAT_MACROS in order to get the
744         # C99 macros on Mac and Linux.
745         'defines': [
746           '__STDC_FORMAT_MACROS',
747         ],
748         'msvs_settings': {
749           'VCCLCompilerTool': {
750             'Detect64BitPortabilityProblems': 'false',
751             # TODO(new_hire): above line should go away
752           },
753         },
754       },
755     }],
756     ['clang==1 and nacl_standalone==1', {
757       'make_global_settings': [
758         ['CC', 'third_party/llvm-build/Release+Asserts/bin/clang'],
759         ['CXX', 'third_party/llvm-build/Release+Asserts/bin/clang++'],
760         ['LINK', '$(CXX)'],
761         ['CC.host', '$(CC)'],
762         ['CXX.host', '$(CXX)'],
763         ['LINK.host', '$(LINK)'],
764       ],
765     }],
766   ],
767   'xcode_settings': {
768     # The Xcode generator will look for an xcode_settings section at the root
769     # of each dict and use it to apply settings on a file-wide basis.  Most
770     # settings should not be here, they should be in target-specific
771     # xcode_settings sections, or better yet, should use non-Xcode-specific
772     # settings in target dicts.  SYMROOT is a special case, because many other
773     # Xcode variables depend on it, including variables such as
774     # PROJECT_DERIVED_FILE_DIR.  When a source group corresponding to something
775     # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
776     # files to appear (when present) in the UI as actual files and not red
777     # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
778     # and therefore SYMROOT, needs to be set at the project level.
779     'SYMROOT': '<(DEPTH)/xcodebuild',
780   },
781   'includes': [
782     'untrusted.gypi',
783   ],
784 }