Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1152)

Side by Side Diff: pylib/gyp/__init__.py

Issue 10795044: Support Mac android cross compile. Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pylib/gyp/common.py » ('j') | pylib/gyp/common.py » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 env_name='GYP_GENERATOR_OUTPUT', 313 env_name='GYP_GENERATOR_OUTPUT',
314 help='puts generated build files under DIR') 314 help='puts generated build files under DIR')
315 parser.add_option('--ignore-environment', dest='use_environment', 315 parser.add_option('--ignore-environment', dest='use_environment',
316 action='store_false', default=True, regenerate=False, 316 action='store_false', default=True, regenerate=False,
317 help='do not read options from environment variables') 317 help='do not read options from environment variables')
318 parser.add_option('--check', dest='check', action='store_true', 318 parser.add_option('--check', dest='check', action='store_true',
319 help='check format of gyp files') 319 help='check format of gyp files')
320 parser.add_option('--toplevel-dir', dest='toplevel_dir', action='store', 320 parser.add_option('--toplevel-dir', dest='toplevel_dir', action='store',
321 default=None, metavar='DIR', type='path', 321 default=None, metavar='DIR', type='path',
322 help='directory to use as the root of the source tree') 322 help='directory to use as the root of the source tree')
323 parser.add_option('--host-flavor', dest='host_flavor', action='store',
324 env_name='GYP_HOST_FLAVOR', regenerate=False,
325 help='overrides host OS flavor used to crosscompile')
323 # --no-circular-check disables the check for circular relationships between 326 # --no-circular-check disables the check for circular relationships between
324 # .gyp files. These relationships should not exist, but they've only been 327 # .gyp files. These relationships should not exist, but they've only been
325 # observed to be harmful with the Xcode generator. Chromium's .gyp files 328 # observed to be harmful with the Xcode generator. Chromium's .gyp files
326 # currently have some circular relationships on non-Mac platforms, so this 329 # currently have some circular relationships on non-Mac platforms, so this
327 # option allows the strict behavior to be used on Macs and the lenient 330 # option allows the strict behavior to be used on Macs and the lenient
328 # behavior to be used elsewhere. 331 # behavior to be used elsewhere.
329 # TODO(mark): Remove this option when http://crbug.com/35878 is fixed. 332 # TODO(mark): Remove this option when http://crbug.com/35878 is fixed.
330 parser.add_option('--no-circular-check', dest='circular_check', 333 parser.add_option('--no-circular-check', dest='circular_check',
331 action='store_false', default=True, regenerate=False, 334 action='store_false', default=True, regenerate=False,
332 help="don't check for circular relationships between files") 335 help="don't check for circular relationships between files")
(...skipping 11 matching lines...) Expand all
344 if not os.path.exists(home_dot_gyp): 347 if not os.path.exists(home_dot_gyp):
345 home_dot_gyp = None 348 home_dot_gyp = None
346 else: 349 else:
347 break 350 break
348 351
349 # TODO(thomasvl): add support for ~/.gyp/defaults 352 # TODO(thomasvl): add support for ~/.gyp/defaults
350 353
351 options, build_files_arg = parser.parse_args(args) 354 options, build_files_arg = parser.parse_args(args)
352 build_files = build_files_arg 355 build_files = build_files_arg
353 356
357 if not options.host_flavor and options.use_environment:
358 options.host_flavor = os.environ.get('GYP_HOST_FLAVOR', '')
Torne 2012/08/21 09:47:17 Setting this to the empty string is a little gross
359
354 if not options.formats: 360 if not options.formats:
355 # If no format was given on the command line, then check the env variable. 361 # If no format was given on the command line, then check the env variable.
356 generate_formats = [] 362 generate_formats = []
357 if options.use_environment: 363 if options.use_environment:
358 generate_formats = os.environ.get('GYP_GENERATORS', []) 364 generate_formats = os.environ.get('GYP_GENERATORS', [])
359 if generate_formats: 365 if generate_formats:
360 generate_formats = re.split('[\s,]', generate_formats) 366 generate_formats = re.split('[\s,]', generate_formats)
361 if generate_formats: 367 if generate_formats:
362 options.formats = generate_formats 368 options.formats = generate_formats
363 else: 369 else:
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 514
509 def main(args): 515 def main(args):
510 try: 516 try:
511 return gyp_main(args) 517 return gyp_main(args)
512 except GypError, e: 518 except GypError, e:
513 sys.stderr.write("gyp: %s\n" % e) 519 sys.stderr.write("gyp: %s\n" % e)
514 return 1 520 return 1
515 521
516 if __name__ == '__main__': 522 if __name__ == '__main__':
517 sys.exit(main(sys.argv[1:])) 523 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « no previous file | pylib/gyp/common.py » ('j') | pylib/gyp/common.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698