OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2012 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 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 args.append('--no-circular-check') | 138 args.append('--no-circular-check') |
139 | 139 |
140 # Default to ninja on linux, but only if no generator has explicitly been set. | 140 # Default to ninja on linux, but only if no generator has explicitly been set. |
141 # Also default to ninja on mac, but only when not building chrome/ios. | 141 # Also default to ninja on mac, but only when not building chrome/ios. |
142 # . -f / --format has precedence over the env var, no need to check for it | 142 # . -f / --format has precedence over the env var, no need to check for it |
143 # . set the env var only if it hasn't been set yet | 143 # . set the env var only if it hasn't been set yet |
144 # . chromium.gyp_env has been applied to os.environ at this point already | 144 # . chromium.gyp_env has been applied to os.environ at this point already |
145 if sys.platform.startswith('linux') and not os.environ.get('GYP_GENERATORS'): | 145 if sys.platform.startswith('linux') and not os.environ.get('GYP_GENERATORS'): |
146 os.environ['GYP_GENERATORS'] = 'ninja' | 146 os.environ['GYP_GENERATORS'] = 'ninja' |
147 elif sys.platform == 'darwin' and not os.environ.get('GYP_GENERATORS') and \ | 147 elif sys.platform == 'darwin' and not os.environ.get('GYP_GENERATORS') and \ |
148 not 'OS=ios' in os.environ.get('GYP_DEFINES'): | 148 not 'OS=ios' in os.environ.get('GYP_DEFINES', []): |
149 os.environ['GYP_GENERATORS'] = 'ninja' | 149 os.environ['GYP_GENERATORS'] = 'ninja' |
150 | 150 |
151 # If CHROMIUM_GYP_SYNTAX_CHECK is set to 1, it will invoke gyp with --check | 151 # If CHROMIUM_GYP_SYNTAX_CHECK is set to 1, it will invoke gyp with --check |
152 # to enfore syntax checking. | 152 # to enfore syntax checking. |
153 syntax_check = os.environ.get('CHROMIUM_GYP_SYNTAX_CHECK') | 153 syntax_check = os.environ.get('CHROMIUM_GYP_SYNTAX_CHECK') |
154 if syntax_check and int(syntax_check): | 154 if syntax_check and int(syntax_check): |
155 args.append('--check') | 155 args.append('--check') |
156 | 156 |
157 print 'Updating projects from gyp files...' | 157 print 'Updating projects from gyp files...' |
158 sys.stdout.flush() | 158 sys.stdout.flush() |
159 | 159 |
160 # Off we go... | 160 # Off we go... |
161 sys.exit(gyp.main(args)) | 161 sys.exit(gyp.main(args)) |
OLD | NEW |