| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2016 The Dart project authors. All rights reserved. | 2 # Copyright 2016 The Dart project authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import argparse | 6 import argparse |
| 7 import multiprocessing | 7 import multiprocessing |
| 8 import os | 8 import os |
| 9 import shutil | 9 import shutil |
| 10 import subprocess | 10 import subprocess |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 | 137 |
| 138 def ToGnArgs(args, mode, arch, target_os): | 138 def ToGnArgs(args, mode, arch, target_os): |
| 139 gn_args = {} | 139 gn_args = {} |
| 140 | 140 |
| 141 host_os = HostOsForGn(HOST_OS) | 141 host_os = HostOsForGn(HOST_OS) |
| 142 if target_os == 'host': | 142 if target_os == 'host': |
| 143 gn_args['target_os'] = host_os | 143 gn_args['target_os'] = host_os |
| 144 else: | 144 else: |
| 145 gn_args['target_os'] = target_os | 145 gn_args['target_os'] = target_os |
| 146 | 146 |
| 147 if arch.startswith('mips'): |
| 148 bold = '\033[1m' |
| 149 reset = '\033[0m' |
| 150 print(bold + "Warning: MIPS architectures are unlikely to be supported in " |
| 151 "upcoming releases. Please consider using another architecture " |
| 152 "and/or file an issue explaining your specific use of and need for " |
| 153 "MIPS support." + reset) |
| 154 |
| 147 gn_args['dart_target_arch'] = arch | 155 gn_args['dart_target_arch'] = arch |
| 148 gn_args['target_cpu'] = TargetCpuForArch(arch, target_os) | 156 gn_args['target_cpu'] = TargetCpuForArch(arch, target_os) |
| 149 gn_args['host_cpu'] = HostCpuForArch(arch) | 157 gn_args['host_cpu'] = HostCpuForArch(arch) |
| 150 crossbuild = gn_args['target_cpu'] != gn_args['host_cpu'] | 158 crossbuild = gn_args['target_cpu'] != gn_args['host_cpu'] |
| 151 | 159 |
| 152 # See: runtime/observatory/BUILD.gn. | 160 # See: runtime/observatory/BUILD.gn. |
| 153 # This allows the standalone build of the observatory to fall back on | 161 # This allows the standalone build of the observatory to fall back on |
| 154 # dart_bootstrap if the prebuilt SDK doesn't work. | 162 # dart_bootstrap if the prebuilt SDK doesn't work. |
| 155 gn_args['dart_host_pub_exe'] = "" | 163 gn_args['dart_host_pub_exe'] = "" |
| 156 | 164 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 | 245 |
| 238 | 246 |
| 239 def ProcessOsOption(os_name): | 247 def ProcessOsOption(os_name): |
| 240 if os_name == 'host': | 248 if os_name == 'host': |
| 241 return HOST_OS | 249 return HOST_OS |
| 242 return os_name | 250 return os_name |
| 243 | 251 |
| 244 | 252 |
| 245 def ProcessOptions(args): | 253 def ProcessOptions(args): |
| 246 if args.arch == 'all': | 254 if args.arch == 'all': |
| 247 args.arch = 'ia32,x64,simarm,simarm64,simmips,simdbc64' | 255 args.arch = 'ia32,x64,simarm,simarm64,simdbc64' |
| 248 if args.mode == 'all': | 256 if args.mode == 'all': |
| 249 args.mode = 'debug,release,product' | 257 args.mode = 'debug,release,product' |
| 250 if args.os == 'all': | 258 if args.os == 'all': |
| 251 args.os = 'host,android' | 259 args.os = 'host,android' |
| 252 args.mode = args.mode.split(',') | 260 args.mode = args.mode.split(',') |
| 253 args.arch = args.arch.split(',') | 261 args.arch = args.arch.split(',') |
| 254 args.os = args.os.split(',') | 262 args.os = args.os.split(',') |
| 255 for mode in args.mode: | 263 for mode in args.mode: |
| 256 if not mode in ['debug', 'release', 'product']: | 264 if not mode in ['debug', 'release', 'product']: |
| 257 print "Unknown mode %s" % mode | 265 print "Unknown mode %s" % mode |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 return 1 | 461 return 1 |
| 454 | 462 |
| 455 endtime = time.time() | 463 endtime = time.time() |
| 456 if args.verbose: | 464 if args.verbose: |
| 457 print ("GN Time: %.3f seconds" % (endtime - starttime)) | 465 print ("GN Time: %.3f seconds" % (endtime - starttime)) |
| 458 return 0 | 466 return 0 |
| 459 | 467 |
| 460 | 468 |
| 461 if __name__ == '__main__': | 469 if __name__ == '__main__': |
| 462 sys.exit(Main(sys.argv)) | 470 sys.exit(Main(sys.argv)) |
| OLD | NEW |