Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / native_client / build / gyp_nacl
1 #!/usr/bin/python
2
3 # This script is wrapper for NaCl that adds some support for how GYP
4 # is invoked by NaCl beyond what can be done it the gclient hooks.
5
6 import glob
7 import os
8 import shlex
9 import sys
10
11 print 'Updating projects from gyp files...'
12
13 try:
14   import gyp
15 except ImportError, e:
16   sys.path.append(os.path.join(os.path.dirname(sys.argv[0]),
17                                '..', '..', 'tools', 'gyp', 'pylib'))
18   import gyp
19
20 if __name__ == '__main__':
21   args = sys.argv[1:]
22
23   # If we didn't get a file, check an env var, and then fall back to
24   # assuming 'src/build/all.gyp'
25   if len(args) == 0:
26     args += shlex.split(os.environ.get('NACL_GYP_FILE',
27                                        'native_client/build/all.gyp'))
28
29   # Add settings that are only included in the standalone NaCl Gyp
30   # build and won't get included when NaCl is built as part of another
31   # project, such as Chrome.  configs.gypi includes compiler
32   # configuration that arguably should be built into Gyp; Chrome
33   # provides its own conflicting version in its common.gypi.
34   args += ['-I', 'native_client/build/configs.gypi']
35   # Enable warnings that we don't necessarily want to enable for
36   # Chrome source that is built as NaCl untrusted code.
37   args += ['-I', 'native_client/build/standalone_flags.gypi']
38
39   # Pick depth explicitly.
40   args += ['--depth', '.']
41
42   # Building NaCl as standalone (not as part of Chrome)
43   args += ['-D', 'nacl_standalone=1']
44
45   # Off we go...
46   sys.exit(gyp.main(args))