| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 | 2 |
| 3 # Copyright (c) 2012 Google Inc. All rights reserved. | 3 # Copyright (c) 2012 Google Inc. 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 import copy | 7 import copy |
| 8 import gyp.input | 8 import gyp.input |
| 9 import optparse | 9 import optparse |
| 10 import os.path | 10 import os.path |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 | 364 |
| 365 if home_dot_gyp and not os.path.exists(home_dot_gyp): | 365 if home_dot_gyp and not os.path.exists(home_dot_gyp): |
| 366 home_dot_gyp = None | 366 home_dot_gyp = None |
| 367 | 367 |
| 368 if not options.formats: | 368 if not options.formats: |
| 369 # If no format was given on the command line, then check the env variable. | 369 # If no format was given on the command line, then check the env variable. |
| 370 generate_formats = [] | 370 generate_formats = [] |
| 371 if options.use_environment: | 371 if options.use_environment: |
| 372 generate_formats = os.environ.get('GYP_GENERATORS', []) | 372 generate_formats = os.environ.get('GYP_GENERATORS', []) |
| 373 if generate_formats: | 373 if generate_formats: |
| 374 generate_formats = re.split('[\s,]', generate_formats) | 374 generate_formats = re.split(r'[\s,]', generate_formats) |
| 375 if generate_formats: | 375 if generate_formats: |
| 376 options.formats = generate_formats | 376 options.formats = generate_formats |
| 377 else: | 377 else: |
| 378 # Nothing in the variable, default based on platform. | 378 # Nothing in the variable, default based on platform. |
| 379 if sys.platform == 'darwin': | 379 if sys.platform == 'darwin': |
| 380 options.formats = ['xcode'] | 380 options.formats = ['xcode'] |
| 381 elif sys.platform in ('win32', 'cygwin'): | 381 elif sys.platform in ('win32', 'cygwin'): |
| 382 options.formats = ['msvs'] | 382 options.formats = ['msvs'] |
| 383 else: | 383 else: |
| 384 options.formats = ['make'] | 384 options.formats = ['make'] |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 except GypError, e: | 526 except GypError, e: |
| 527 sys.stderr.write("gyp: %s\n" % e) | 527 sys.stderr.write("gyp: %s\n" % e) |
| 528 return 1 | 528 return 1 |
| 529 | 529 |
| 530 # NOTE: setuptools generated console_scripts calls function with no arguments | 530 # NOTE: setuptools generated console_scripts calls function with no arguments |
| 531 def script_main(): | 531 def script_main(): |
| 532 return main(sys.argv[1:]) | 532 return main(sys.argv[1:]) |
| 533 | 533 |
| 534 if __name__ == '__main__': | 534 if __name__ == '__main__': |
| 535 sys.exit(script_main()) | 535 sys.exit(script_main()) |
| OLD | NEW |