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

Side by Side Diff: SConstruct

Issue 60046: Apply Lei Zhang's patch to add easy import of additional environment... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 8 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2008 the V8 project authors. All rights reserved. 1 # Copyright 2008 the V8 project authors. All rights reserved.
2 # Redistribution and use in source and binary forms, with or without 2 # Redistribution and use in source and binary forms, with or without
3 # modification, are permitted provided that the following conditions are 3 # modification, are permitted provided that the following conditions are
4 # met: 4 # met:
5 # 5 #
6 # * Redistributions of source code must retain the above copyright 6 # * Redistributions of source code must retain the above copyright
7 # notice, this list of conditions and the following disclaimer. 7 # notice, this list of conditions and the following disclaimer.
8 # * Redistributions in binary form must reproduce the above 8 # * Redistributions in binary form must reproduce the above
9 # copyright notice, this list of conditions and the following 9 # copyright notice, this list of conditions and the following
10 # disclaimer in the documentation and/or other materials provided 10 # disclaimer in the documentation and/or other materials provided
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 'help': 'the console to use for the d8 shell' 501 'help': 'the console to use for the d8 shell'
502 } 502 }
503 } 503 }
504 504
505 505
506 def GetOptions(): 506 def GetOptions():
507 result = Options() 507 result = Options()
508 result.Add('mode', 'compilation mode (debug, release)', 'release') 508 result.Add('mode', 'compilation mode (debug, release)', 'release')
509 result.Add('sample', 'build sample (shell, process)', '') 509 result.Add('sample', 'build sample (shell, process)', '')
510 result.Add('env', 'override environment settings (NAME1:value1,NAME2:value2)', '') 510 result.Add('env', 'override environment settings (NAME1:value1,NAME2:value2)', '')
511 result.Add('importenv', 'import environment settings (NAME1,NAME2)', '')
Kevin Millikin (Chromium) 2009/04/02 12:54:11 Might be clearer to have the message string: 'imp
511 for (name, option) in SIMPLE_OPTIONS.iteritems(): 512 for (name, option) in SIMPLE_OPTIONS.iteritems():
512 help = '%s (%s)' % (name, ", ".join(option['values'])) 513 help = '%s (%s)' % (name, ", ".join(option['values']))
513 result.Add(name, help, option.get('default')) 514 result.Add(name, help, option.get('default'))
514 return result 515 return result
515 516
516 517
517 def SplitList(str): 518 def SplitList(str):
518 return [ s for s in str.split(",") if len(s) > 0 ] 519 return [ s for s in str.split(",") if len(s) > 0 ]
519 520
520 521
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 620
620 def PostprocessOptions(options): 621 def PostprocessOptions(options):
621 # Adjust architecture if the simulator option has been set 622 # Adjust architecture if the simulator option has been set
622 if (options['simulator'] != 'none') and (options['arch'] != options['simulator ']): 623 if (options['simulator'] != 'none') and (options['arch'] != options['simulator ']):
623 if 'arch' in ARGUMENTS: 624 if 'arch' in ARGUMENTS:
624 # Print a warning if arch has explicitly been set 625 # Print a warning if arch has explicitly been set
625 print "Warning: forcing architecture to match simulator (%s)" % options['s imulator'] 626 print "Warning: forcing architecture to match simulator (%s)" % options['s imulator']
626 options['arch'] = options['simulator'] 627 options['arch'] = options['simulator']
627 628
628 629
629 def ParseEnvOverrides(arg): 630 def ParseEnvOverrides(arg, imports):
630 # The environment overrides are in the format NAME1:value1,NAME2:value2 631 # The environment overrides are in the format NAME1:value1,NAME2:value2
632 # The environment imports are in the format NAME1,NAME2
Kevin Millikin (Chromium) 2009/04/02 12:54:11 Analogously here.
631 overrides = {} 633 overrides = {}
634 for var in imports.split(','):
635 if var in os.environ:
636 overrides[var] = os.environ[var]
632 for override in arg.split(','): 637 for override in arg.split(','):
633 pos = override.find(':') 638 pos = override.find(':')
634 if pos == -1: 639 if pos == -1:
635 continue 640 continue
636 overrides[override[:pos].strip()] = override[pos+1:].strip() 641 overrides[override[:pos].strip()] = override[pos+1:].strip()
637 return overrides 642 return overrides
638 643
639 644
640 def BuildSpecific(env, mode, env_overrides): 645 def BuildSpecific(env, mode, env_overrides):
641 options = {'mode': mode} 646 options = {'mode': mode}
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 context.cctest_targets.append(cctest_program) 724 context.cctest_targets.append(cctest_program)
720 725
721 return context 726 return context
722 727
723 728
724 def Build(): 729 def Build():
725 opts = GetOptions() 730 opts = GetOptions()
726 env = Environment(options=opts) 731 env = Environment(options=opts)
727 Help(opts.GenerateHelpText(env)) 732 Help(opts.GenerateHelpText(env))
728 VerifyOptions(env) 733 VerifyOptions(env)
729 env_overrides = ParseEnvOverrides(env['env']) 734 env_overrides = ParseEnvOverrides(env['env'], env['importenv'])
730 735
731 SourceSignatures(env['sourcesignatures']) 736 SourceSignatures(env['sourcesignatures'])
732 737
733 libraries = [] 738 libraries = []
734 mksnapshots = [] 739 mksnapshots = []
735 cctests = [] 740 cctests = []
736 samples = [] 741 samples = []
737 d8s = [] 742 d8s = []
738 modes = SplitList(env['mode']) 743 modes = SplitList(env['mode'])
739 for mode in modes: 744 for mode in modes:
(...skipping 21 matching lines...) Expand all
761 # version of scons. Also, there's a bug in some revisions that 766 # version of scons. Also, there's a bug in some revisions that
762 # doesn't allow this flag to be set, so we swallow any exceptions. 767 # doesn't allow this flag to be set, so we swallow any exceptions.
763 # Lovely. 768 # Lovely.
764 try: 769 try:
765 SetOption('warn', 'no-deprecated') 770 SetOption('warn', 'no-deprecated')
766 except: 771 except:
767 pass 772 pass
768 773
769 774
770 Build() 775 Build()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698