| 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 subprocess | 7 import subprocess |
| 8 import sys | 8 import sys |
| 9 import os | 9 import os |
| 10 import utils | 10 import utils |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 return 'mipsel' | 41 return 'mipsel' |
| 42 if arch == 'simdbc': | 42 if arch == 'simdbc': |
| 43 return 'arm' if os == 'android' else 'x86' | 43 return 'arm' if os == 'android' else 'x86' |
| 44 if arch == 'simdbc64': | 44 if arch == 'simdbc64': |
| 45 return 'arm64' if os == 'android' else 'x64' | 45 return 'arm64' if os == 'android' else 'x64' |
| 46 return arch | 46 return arch |
| 47 | 47 |
| 48 def to_gn_args(args): | 48 def to_gn_args(args): |
| 49 gn_args = {} | 49 gn_args = {} |
| 50 | 50 |
| 51 host_os = HOST_OS |
| 52 if HOST_OS == 'macos': |
| 53 host_os = 'mac' |
| 51 if args.os == 'host': | 54 if args.os == 'host': |
| 52 gn_args['target_os'] = HOST_OS | 55 gn_args['target_os'] = host_os |
| 53 else: | 56 else: |
| 54 gn_args['target_os'] = args.os | 57 gn_args['target_os'] = args.os |
| 55 | 58 |
| 56 gn_args['dart_target_arch'] = args.arch | 59 gn_args['dart_target_arch'] = args.arch |
| 57 gn_args['target_cpu'] = target_cpu_for_arch(args.arch, args.os) | 60 gn_args['target_cpu'] = target_cpu_for_arch(args.arch, args.os) |
| 58 gn_args['host_cpu'] = host_cpu_for_arch(args.arch) | 61 gn_args['host_cpu'] = host_cpu_for_arch(args.arch) |
| 59 | 62 |
| 60 # TODO(zra): This is for the observatory, which currently builds using the | 63 # TODO(zra): This is for the observatory, which currently builds using the |
| 61 # checked-in sdk. If/when the observatory no longer builds with the | 64 # checked-in sdk. If/when the observatory no longer builds with the |
| 62 # checked-in sdk, this can be removed. | 65 # checked-in sdk, this can be removed. |
| 63 gn_args['dart_host_pub_exe'] = os.path.join( | 66 gn_args['dart_host_pub_exe'] = os.path.join( |
| 64 DART_ROOT, 'tools', 'sdks', HOST_OS, 'dart-sdk', 'bin', 'pub') | 67 DART_ROOT, 'tools', 'sdks', host_os, 'dart-sdk', 'bin', 'pub') |
| 65 | 68 |
| 66 # For Fuchsia support, the default is to not compile in the root | 69 # For Fuchsia support, the default is to not compile in the root |
| 67 # certificates. | 70 # certificates. |
| 68 gn_args['dart_use_fallback_root_certificates'] = True | 71 gn_args['dart_use_fallback_root_certificates'] = True |
| 69 | 72 |
| 70 gn_args['dart_zlib_path'] = "//runtime/bin/zlib" | 73 gn_args['dart_zlib_path'] = "//runtime/bin/zlib" |
| 71 | 74 |
| 72 gn_args['dart_use_tcmalloc'] = gn_args['target_os'] == 'linux' | 75 gn_args['dart_use_tcmalloc'] = gn_args['target_os'] == 'linux' |
| 73 | 76 |
| 74 gn_args['is_debug'] = args.mode == 'debug' | 77 gn_args['is_debug'] = args.mode == 'debug' |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 ] | 155 ] |
| 153 gn_args = to_command_line(to_gn_args(args)) | 156 gn_args = to_command_line(to_gn_args(args)) |
| 154 out_dir = get_out_dir(args) | 157 out_dir = get_out_dir(args) |
| 155 print "gn gen --check in %s" % out_dir | 158 print "gn gen --check in %s" % out_dir |
| 156 command.append(out_dir) | 159 command.append(out_dir) |
| 157 command.append('--args=%s' % ' '.join(gn_args)) | 160 command.append('--args=%s' % ' '.join(gn_args)) |
| 158 return subprocess.call(command, cwd=DART_ROOT) | 161 return subprocess.call(command, cwd=DART_ROOT) |
| 159 | 162 |
| 160 if __name__ == '__main__': | 163 if __name__ == '__main__': |
| 161 sys.exit(main(sys.argv)) | 164 sys.exit(main(sys.argv)) |
| OLD | NEW |