OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 3 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
4 # for details. All rights reserved. Use of this source code is governed by a | 4 # for details. All rights reserved. Use of this source code is governed by a |
5 # BSD-style license that can be found in the LICENSE file. | 5 # BSD-style license that can be found in the LICENSE file. |
6 | 6 |
7 import os | 7 import os |
8 import sys | 8 import sys |
9 import platform | 9 import platform |
10 | 10 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
42 # Add gyp to the imports and if needed get it from the third_party location | 42 # Add gyp to the imports and if needed get it from the third_party location |
43 # inside the standalone dart gclient checkout. | 43 # inside the standalone dart gclient checkout. |
44 try: | 44 try: |
45 import gyp | 45 import gyp |
46 except ImportError, e: | 46 except ImportError, e: |
47 sys.path.append(os.path.abspath(gyp_pylib)) | 47 sys.path.append(os.path.abspath(gyp_pylib)) |
48 import gyp | 48 import gyp |
49 | 49 |
50 | 50 |
51 if __name__ == '__main__': | 51 if __name__ == '__main__': |
52 dart_root = os.path.dirname(os.path.abspath(os.path.dirname(__file__))) | |
53 | |
52 # Make our own location absolute as it is stored in Makefiles. | 54 # Make our own location absolute as it is stored in Makefiles. |
53 sys.argv[0] = os.path.abspath(sys.argv[0]) | 55 sys.argv[0] = os.path.abspath(sys.argv[0]) |
54 | 56 |
55 # Add any extra arguments. Needed by compiler/dart.gyp to build v8. | 57 # Add any extra arguments. Needed by compiler/dart.gyp to build v8. |
56 args = sys.argv[2:] | 58 args = sys.argv[2:] |
57 | 59 |
58 args += ['--depth', project_src] | 60 args += ['--depth', project_src] |
61 args += ['-D', 'DART_ROOT=' + dart_root] | |
Ivan Posva
2013/03/13 09:44:40
I would prefer if we did not have to pass this val
kustermann
2013/03/13 15:30:29
As discussed offline, we don't need this anymore a
| |
59 args += ['-I', './tools/gyp/common.gypi'] | 62 args += ['-I', './tools/gyp/common.gypi'] |
60 | 63 |
61 if platform.system() == 'Linux': | 64 if platform.system() == 'Linux': |
62 # We need to fiddle with toplevel-dir to work around a GYP bug | 65 # We need to fiddle with toplevel-dir to work around a GYP bug |
63 # that breaks building v8 from compiler/dart.gyp. | 66 # that breaks building v8 from compiler/dart.gyp. |
64 args += ['--toplevel-dir', os.curdir] | 67 args += ['--toplevel-dir', os.curdir] |
65 args += ['--generator-output', project_src] | 68 args += ['--generator-output', project_src] |
66 else: | 69 else: |
67 # On at least the Mac, the toplevel-dir should be where the | 70 # On at least the Mac, the toplevel-dir should be where the |
68 # sources are. Otherwise, Xcode won't show sources correctly. | 71 # sources are. Otherwise, Xcode won't show sources correctly. |
69 args += ['--toplevel-dir', project_src] | 72 args += ['--toplevel-dir', project_src] |
70 | 73 |
71 if sys.platform == 'win32': | 74 if sys.platform == 'win32': |
72 # Generate Visual Studio 2008 compatible files by default. | 75 # Generate Visual Studio 2008 compatible files by default. |
73 if not os.environ.get('GYP_MSVS_VERSION'): | 76 if not os.environ.get('GYP_MSVS_VERSION'): |
74 args.extend(['-G', 'msvs_version=2008']) | 77 args.extend(['-G', 'msvs_version=2008']) |
75 | 78 |
76 # Change into the dart directory as we want the project to be rooted here. | 79 # Change into the dart directory as we want the project to be rooted here. |
77 # Also, GYP is very sensitive to exacly from where it is being run. | 80 # Also, GYP is very sensitive to exacly from where it is being run. |
78 os.chdir(dart_src) | 81 os.chdir(dart_src) |
79 | 82 |
80 args += [GetProjectGypFile(project_src)] | 83 args += [GetProjectGypFile(project_src)] |
81 | 84 |
82 # Generate the projects. | 85 # Generate the projects. |
83 sys.exit(gyp.main(args)) | 86 sys.exit(gyp.main(args)) |
OLD | NEW |