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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
291 env_name='GYP_GENERATOR_OUTPUT', | 291 env_name='GYP_GENERATOR_OUTPUT', |
292 help='puts generated build files under DIR') | 292 help='puts generated build files under DIR') |
293 parser.add_option('--ignore-environment', dest='use_environment', | 293 parser.add_option('--ignore-environment', dest='use_environment', |
294 action='store_false', default=True, regenerate=False, | 294 action='store_false', default=True, regenerate=False, |
295 help='do not read options from environment variables') | 295 help='do not read options from environment variables') |
296 parser.add_option('--check', dest='check', action='store_true', | 296 parser.add_option('--check', dest='check', action='store_true', |
297 help='check format of gyp files') | 297 help='check format of gyp files') |
298 parser.add_option('--toplevel-dir', dest='toplevel_dir', action='store', | 298 parser.add_option('--toplevel-dir', dest='toplevel_dir', action='store', |
299 default=None, metavar='DIR', type='path', | 299 default=None, metavar='DIR', type='path', |
300 help='directory to use as the root of the source tree') | 300 help='directory to use as the root of the source tree') |
301 parser.add_option('--host-flavor', dest='host_flavor', action='store', | |
302 env_name='GYP_HOST_FLAVOR', regenerate=False, | |
303 help='To override the value of the build os') | |
Torne
2012/08/14 11:04:01
Help messages don't start with a capital, and "to"
| |
301 # --no-circular-check disables the check for circular relationships between | 304 # --no-circular-check disables the check for circular relationships between |
302 # .gyp files. These relationships should not exist, but they've only been | 305 # .gyp files. These relationships should not exist, but they've only been |
303 # observed to be harmful with the Xcode generator. Chromium's .gyp files | 306 # observed to be harmful with the Xcode generator. Chromium's .gyp files |
304 # currently have some circular relationships on non-Mac platforms, so this | 307 # currently have some circular relationships on non-Mac platforms, so this |
305 # option allows the strict behavior to be used on Macs and the lenient | 308 # option allows the strict behavior to be used on Macs and the lenient |
306 # behavior to be used elsewhere. | 309 # behavior to be used elsewhere. |
307 # TODO(mark): Remove this option when http://crbug.com/35878 is fixed. | 310 # TODO(mark): Remove this option when http://crbug.com/35878 is fixed. |
308 parser.add_option('--no-circular-check', dest='circular_check', | 311 parser.add_option('--no-circular-check', dest='circular_check', |
309 action='store_false', default=True, regenerate=False, | 312 action='store_false', default=True, regenerate=False, |
310 help="don't check for circular relationships between files") | 313 help="don't check for circular relationships between files") |
(...skipping 11 matching lines...) Expand all Loading... | |
322 if not os.path.exists(home_dot_gyp): | 325 if not os.path.exists(home_dot_gyp): |
323 home_dot_gyp = None | 326 home_dot_gyp = None |
324 else: | 327 else: |
325 break | 328 break |
326 | 329 |
327 # TODO(thomasvl): add support for ~/.gyp/defaults | 330 # TODO(thomasvl): add support for ~/.gyp/defaults |
328 | 331 |
329 options, build_files_arg = parser.parse_args(args) | 332 options, build_files_arg = parser.parse_args(args) |
330 build_files = build_files_arg | 333 build_files = build_files_arg |
331 | 334 |
335 if not options.host_flavor: | |
Torne
2012/08/14 11:04:01
needs to also be "and options.use_environment"
| |
336 options.host_flavor = os.environ.get('GYP_HOST_FLAVOR', '') | |
337 | |
332 if not options.formats: | 338 if not options.formats: |
333 # If no format was given on the command line, then check the env variable. | 339 # If no format was given on the command line, then check the env variable. |
334 generate_formats = [] | 340 generate_formats = [] |
335 if options.use_environment: | 341 if options.use_environment: |
336 generate_formats = os.environ.get('GYP_GENERATORS', []) | 342 generate_formats = os.environ.get('GYP_GENERATORS', []) |
337 if generate_formats: | 343 if generate_formats: |
338 generate_formats = re.split('[\s,]', generate_formats) | 344 generate_formats = re.split('[\s,]', generate_formats) |
339 if generate_formats: | 345 if generate_formats: |
340 options.formats = generate_formats | 346 options.formats = generate_formats |
341 else: | 347 else: |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
481 # need to have dependencies defined before dependents reference them should | 487 # need to have dependencies defined before dependents reference them should |
482 # generate targets in the order specified in flat_list. | 488 # generate targets in the order specified in flat_list. |
483 generator.GenerateOutput(flat_list, targets, data, params) | 489 generator.GenerateOutput(flat_list, targets, data, params) |
484 | 490 |
485 # Done | 491 # Done |
486 return 0 | 492 return 0 |
487 | 493 |
488 | 494 |
489 if __name__ == '__main__': | 495 if __name__ == '__main__': |
490 sys.exit(main(sys.argv[1:])) | 496 sys.exit(main(sys.argv[1:])) |
OLD | NEW |