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