| OLD | NEW | 
|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python | 
| 2 # | 2 # | 
| 3 # Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file | 3 # Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file | 
| 4 # for details. All rights reserved. Use of this source code is governed by a | 4 # for details. All rights reserved. Use of this source code is governed by a | 
| 5 # BSD-style license that can be found in the LICENSE file. | 5 # BSD-style license that can be found in the LICENSE file. | 
| 6 # | 6 # | 
| 7 | 7 | 
| 8 import optparse | 8 import optparse | 
| 9 import shutil | 9 import shutil | 
| 10 import sys | 10 import sys | 
| 11 import utils | 11 import utils | 
| 12 | 12 | 
| 13 HOST_OS = utils.GuessOS() | 13 HOST_OS = utils.GuessOS() | 
| 14 | 14 | 
| 15 def BuildOptions(): | 15 def BuildOptions(): | 
| 16   result = optparse.OptionParser() | 16   result = optparse.OptionParser() | 
| 17   result.add_option("-m", "--mode", | 17   result.add_option("-m", "--mode", | 
| 18       help='Build variants (comma-separated).', | 18       help='Build variants (comma-separated).', | 
| 19       metavar='[all,debug,release]', | 19       metavar='[all,debug,release]', | 
| 20       default='debug') | 20       default='all') | 
| 21   result.add_option("--arch", | 21   result.add_option("--arch", | 
| 22       help='Target architectures (comma-separated).', | 22       help='Target architectures (comma-separated).', | 
| 23       metavar='[all,ia32,x64,simarm,arm]', | 23       metavar='[all,ia32,x64,simarm,arm]', | 
| 24       default=utils.GuessArchitecture()) | 24       default=utils.GuessArchitecture()) | 
| 25   return result | 25   return result | 
| 26 | 26 | 
| 27 def ProcessOptions(options): | 27 def ProcessOptions(options): | 
| 28   if options.arch == 'all': | 28   if options.arch == 'all': | 
| 29     options.arch = 'ia32,x64' | 29     options.arch = 'ia32,x64' | 
| 30   if options.mode == 'all': | 30   if options.mode == 'all': | 
| (...skipping 25 matching lines...) Expand all  Loading... | 
| 56       shutil.rmtree(build_root, ignore_errors=True) | 56       shutil.rmtree(build_root, ignore_errors=True) | 
| 57       # On windows we have additional object files within the runtime library. | 57       # On windows we have additional object files within the runtime library. | 
| 58       if HOST_OS == 'win32': | 58       if HOST_OS == 'win32': | 
| 59         runtime_root = 'runtime/' + build_root | 59         runtime_root = 'runtime/' + build_root | 
| 60         print "Deleting %s" % (runtime_root) | 60         print "Deleting %s" % (runtime_root) | 
| 61         shutil.rmtree(runtime_root, ignore_errors=True) | 61         shutil.rmtree(runtime_root, ignore_errors=True) | 
| 62   return 0 | 62   return 0 | 
| 63 | 63 | 
| 64 if __name__ == '__main__': | 64 if __name__ == '__main__': | 
| 65   sys.exit(Main()) | 65   sys.exit(Main()) | 
| OLD | NEW | 
|---|