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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 # currently exist. The check for circular dependencies is currently | 283 # currently exist. The check for circular dependencies is currently |
284 # bypassed on other platforms, but is left enabled on the Mac, where a | 284 # bypassed on other platforms, but is left enabled on the Mac, where a |
285 # violation of the rule causes Xcode to misbehave badly. | 285 # violation of the rule causes Xcode to misbehave badly. |
286 # TODO(mark): Find and kill remaining circular dependencies, and remove this | 286 # TODO(mark): Find and kill remaining circular dependencies, and remove this |
287 # option. http://crbug.com/35878. | 287 # option. http://crbug.com/35878. |
288 # TODO(tc): Fix circular dependencies in ChromiumOS then add linux2 to the | 288 # TODO(tc): Fix circular dependencies in ChromiumOS then add linux2 to the |
289 # list. | 289 # list. |
290 if sys.platform not in ('darwin',): | 290 if sys.platform not in ('darwin',): |
291 args.append('--no-circular-check') | 291 args.append('--no-circular-check') |
292 | 292 |
293 # Default to ninja on linux, but only if no generator has explicitly been set. | 293 # Default to ninja on linux and windows, but only if no generator has |
| 294 # explicitly been set. |
294 # Also default to ninja on mac, but only when not building chrome/ios. | 295 # Also default to ninja on mac, but only when not building chrome/ios. |
295 # . -f / --format has precedence over the env var, no need to check for it | 296 # . -f / --format has precedence over the env var, no need to check for it |
296 # . set the env var only if it hasn't been set yet | 297 # . set the env var only if it hasn't been set yet |
297 # . chromium.gyp_env has been applied to os.environ at this point already | 298 # . chromium.gyp_env has been applied to os.environ at this point already |
298 if sys.platform.startswith('linux') and not os.environ.get('GYP_GENERATORS'): | 299 if sys.platform.startswith('linux') and not os.environ.get('GYP_GENERATORS'): |
299 os.environ['GYP_GENERATORS'] = 'ninja' | 300 os.environ['GYP_GENERATORS'] = 'ninja' |
| 301 if sys.platform.startswith('win') and not os.environ.get('GYP_GENERATORS'): |
| 302 os.environ['GYP_GENERATORS'] = 'ninja' |
300 elif sys.platform == 'darwin' and not os.environ.get('GYP_GENERATORS') and \ | 303 elif sys.platform == 'darwin' and not os.environ.get('GYP_GENERATORS') and \ |
301 not 'OS=ios' in os.environ.get('GYP_DEFINES', []): | 304 not 'OS=ios' in os.environ.get('GYP_DEFINES', []): |
302 os.environ['GYP_GENERATORS'] = 'ninja' | 305 os.environ['GYP_GENERATORS'] = 'ninja' |
303 | 306 |
304 # If using ninja on windows, and not opting out of the the automatic | 307 # If using ninja on windows, and not opting out of the the automatic |
305 # toolchain, then set up variables for the automatic toolchain. Opt-out is | 308 # toolchain, then set up variables for the automatic toolchain. Opt-out is |
306 # on by default, for now. | 309 # on by default, for now. |
307 if (sys.platform in ('win32', 'cygwin') and | 310 if (sys.platform in ('win32', 'cygwin') and |
308 os.environ.get('GYP_GENERATORS') == 'ninja' and | 311 os.environ.get('GYP_GENERATORS') == 'ninja' and |
309 os.environ.get('GYP_MSVS_USE_SYSTEM_TOOLCHAIN', '1') != '1'): | 312 os.environ.get('GYP_MSVS_USE_SYSTEM_TOOLCHAIN', '1') != '1'): |
(...skipping 29 matching lines...) Expand all Loading... |
339 # to enfore syntax checking. | 342 # to enfore syntax checking. |
340 syntax_check = os.environ.get('CHROMIUM_GYP_SYNTAX_CHECK') | 343 syntax_check = os.environ.get('CHROMIUM_GYP_SYNTAX_CHECK') |
341 if syntax_check and int(syntax_check): | 344 if syntax_check and int(syntax_check): |
342 args.append('--check') | 345 args.append('--check') |
343 | 346 |
344 print 'Updating projects from gyp files...' | 347 print 'Updating projects from gyp files...' |
345 sys.stdout.flush() | 348 sys.stdout.flush() |
346 | 349 |
347 # Off we go... | 350 # Off we go... |
348 sys.exit(gyp.main(args)) | 351 sys.exit(gyp.main(args)) |
OLD | NEW |