OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 # Copyright (c) 2012 The Dart Authors. All rights reserved. | 3 # Copyright (c) 2012 The Dart Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """ | 7 """ |
8 Invoke gyp to generate build files for building the Dart VM. | 8 Invoke gyp to generate build files for building the Dart VM. |
9 """ | 9 """ |
10 | 10 |
11 import os | 11 import os |
12 import subprocess | 12 import subprocess |
13 import sys | 13 import sys |
14 | 14 |
15 def execute(args): | 15 def execute(args): |
16 process = subprocess.Popen(args) | 16 process = subprocess.Popen(args) |
17 process.wait() | 17 process.wait() |
18 return process.returncode | 18 return process.returncode |
19 | 19 |
20 def main(): | 20 def main(): |
| 21 component = 'all' |
| 22 if len(sys.argv) == 2: |
| 23 component = sys.argv[1] |
| 24 |
| 25 component_gyp_files = { |
| 26 'all' : 'dart/dart.gyp', |
| 27 'runtime' : 'dart/runtime/dart-runtime.gyp', |
| 28 } |
21 args = ['python', 'dart/third_party/gyp/gyp_main.py', | 29 args = ['python', 'dart/third_party/gyp/gyp_main.py', |
22 '--depth=dart', '-Idart/tools/gyp/all.gypi', 'dart/dart.gyp'] | 30 '--depth=dart', '-Idart/tools/gyp/all.gypi', |
| 31 component_gyp_files[component]] |
23 | 32 |
24 if sys.platform == 'win32': | 33 if sys.platform == 'win32': |
25 # Generate Visual Studio 2010 compatible files by default. | 34 # Generate Visual Studio 2010 compatible files by default. |
26 if not os.environ.get('GYP_MSVS_VERSION'): | 35 if not os.environ.get('GYP_MSVS_VERSION'): |
27 args.extend(['-G', 'msvs_version=2010']) | 36 args.extend(['-G', 'msvs_version=2010']) |
28 | 37 |
29 sys.exit(execute(args)) | 38 sys.exit(execute(args)) |
30 | 39 |
31 if __name__ == '__main__': | 40 if __name__ == '__main__': |
32 main() | 41 main() |
OLD | NEW |