OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2011 The Chromium 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 # This script is wrapper for Chromium that adds some support for how GYP | 7 # This script is wrapper for Chromium that adds some support for how GYP |
8 # is invoked by Chromium beyond what can be done in the gclient hooks. | 8 # is invoked by Chromium beyond what can be done in the gclient hooks. |
9 | 9 |
10 import glob | 10 import glob |
11 import os | 11 import os |
12 import shlex | 12 import shlex |
13 import subprocess | 13 import subprocess |
14 import sys | 14 import sys |
15 | 15 |
16 script_dir = os.path.dirname(__file__) | 16 script_dir = os.path.dirname(__file__) |
17 chrome_src = os.path.abspath(os.path.join(script_dir, os.pardir)) | 17 chrome_src = os.path.abspath(os.path.join(script_dir, os.pardir)) |
18 | 18 |
19 sys.path.insert(0, os.path.join(chrome_src, 'tools', 'gyp', 'pylib')) | 19 sys.path.insert(0, os.path.join(chrome_src, 'tools', 'gyp', 'pylib')) |
20 import gyp | 20 import gyp |
21 | 21 |
| 22 # Add tools/grit so that pymod_do_main(grit_info ...) can find grit_info.py. |
| 23 sys.path.insert(1, os.path.join(chrome_src, 'tools', 'grit')) |
| 24 |
| 25 |
22 # On Windows, Psyco shortens warm runs of build/gyp_chromium by about | 26 # On Windows, Psyco shortens warm runs of build/gyp_chromium by about |
23 # 20 seconds on a z600 machine with 12 GB of RAM, from 90 down to 70 | 27 # 20 seconds on a z600 machine with 12 GB of RAM, from 90 down to 70 |
24 # seconds. Conversely, memory usage of build/gyp_chromium with Psyco | 28 # seconds. Conversely, memory usage of build/gyp_chromium with Psyco |
25 # maxes out at about 158 MB vs. 132 MB without it. | 29 # maxes out at about 158 MB vs. 132 MB without it. |
26 # | 30 # |
27 # Psyco uses native libraries, so we need to load a different | 31 # Psyco uses native libraries, so we need to load a different |
28 # installation depending on which OS we are running under. It has not | 32 # installation depending on which OS we are running under. It has not |
29 # been tested whether using Psyco on our Mac and Linux builds is worth | 33 # been tested whether using Psyco on our Mac and Linux builds is worth |
30 # it (the GYP running time is a lot shorter, so the JIT startup cost | 34 # it (the GYP running time is a lot shorter, so the JIT startup cost |
31 # may not be worth it). | 35 # may not be worth it). |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 # to enfore syntax checking. | 162 # to enfore syntax checking. |
159 syntax_check = os.environ.get('CHROMIUM_GYP_SYNTAX_CHECK') | 163 syntax_check = os.environ.get('CHROMIUM_GYP_SYNTAX_CHECK') |
160 if syntax_check and int(syntax_check): | 164 if syntax_check and int(syntax_check): |
161 args.append('--check') | 165 args.append('--check') |
162 | 166 |
163 print 'Updating projects from gyp files...' | 167 print 'Updating projects from gyp files...' |
164 sys.stdout.flush() | 168 sys.stdout.flush() |
165 | 169 |
166 # Off we go... | 170 # Off we go... |
167 sys.exit(gyp.main(args)) | 171 sys.exit(gyp.main(args)) |
OLD | NEW |