| 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 subprocess | 9 import subprocess |
| 10 import sys | 10 import sys |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 gn_args['dart_debug'] = mode == 'debug' | 158 gn_args['dart_debug'] = mode == 'debug' |
| 159 | 159 |
| 160 # This setting is only meaningful for Flutter. Standalone builds of the VM | 160 # This setting is only meaningful for Flutter. Standalone builds of the VM |
| 161 # should leave this set to 'develop', which causes the build to defer to | 161 # should leave this set to 'develop', which causes the build to defer to |
| 162 # 'is_debug', 'is_release' and 'is_product'. | 162 # 'is_debug', 'is_release' and 'is_product'. |
| 163 gn_args['dart_runtime_mode'] = 'develop' | 163 gn_args['dart_runtime_mode'] = 'develop' |
| 164 | 164 |
| 165 # TODO(zra): Investigate using clang with these configurations. | 165 # TODO(zra): Investigate using clang with these configurations. |
| 166 # Clang compiles tcmalloc's inline assembly for ia32 on Linux wrong, so we | 166 # Clang compiles tcmalloc's inline assembly for ia32 on Linux wrong, so we |
| 167 # don't use clang in that configuration. Thus, we use gcc for ia32 *unless* | 167 # don't use clang in that configuration. Thus, we use gcc for ia32 *unless* |
| 168 # a clang-based sanitizer is specified. | 168 # asan or tsan is specified. |
| 169 has_clang = (host_os != 'win' | 169 has_clang = (host_os != 'win' |
| 170 and args.os not in ['android'] |
| 171 and not gn_args['target_cpu'].startswith('arm') |
| 170 and not gn_args['target_cpu'].startswith('mips') | 172 and not gn_args['target_cpu'].startswith('mips') |
| 171 and not ((gn_args['target_os'] == 'linux') | 173 and not ((gn_args['target_os'] == 'linux') |
| 172 and (gn_args['host_cpu'] == 'x86') | 174 and (gn_args['host_cpu'] == 'x86') |
| 173 and not args.asan | 175 and not args.asan |
| 174 and not args.msan | 176 and not args.msan |
| 175 and not args.tsan)) # Use clang for sanitizer builds. | 177 and not args.tsan)) # Use clang for sanitizer builds. |
| 176 gn_args['is_clang'] = args.clang and has_clang | 178 gn_args['is_clang'] = args.clang and has_clang |
| 177 | 179 |
| 178 gn_args['is_asan'] = args.asan and gn_args['is_clang'] | 180 gn_args['is_asan'] = args.asan and gn_args['is_clang'] |
| 179 gn_args['is_msan'] = args.msan and gn_args['is_clang'] | 181 gn_args['is_msan'] = args.msan and gn_args['is_clang'] |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 return False | 241 return False |
| 240 oses = [process_os_option(os_name) for os_name in args.os] | 242 oses = [process_os_option(os_name) for os_name in args.os] |
| 241 for os_name in oses: | 243 for os_name in oses: |
| 242 if not os_name in ['android', 'freebsd', 'linux', 'macos', 'win32']: | 244 if not os_name in ['android', 'freebsd', 'linux', 'macos', 'win32']: |
| 243 print "Unknown os %s" % os_name | 245 print "Unknown os %s" % os_name |
| 244 return False | 246 return False |
| 245 if os_name != HOST_OS: | 247 if os_name != HOST_OS: |
| 246 if os_name != 'android': | 248 if os_name != 'android': |
| 247 print "Unsupported target os %s" % os_name | 249 print "Unsupported target os %s" % os_name |
| 248 return False | 250 return False |
| 249 if not HOST_OS in ['linux', 'macos']: | 251 if not HOST_OS in ['linux']: |
| 250 print ("Cross-compilation to %s is not supported on host os %s." | 252 print ("Cross-compilation to %s is not supported on host os %s." |
| 251 % (os_name, HOST_OS)) | 253 % (os_name, HOST_OS)) |
| 252 return False | 254 return False |
| 253 if not arch in ['ia32', 'x64', 'arm', 'armv6', 'armv5te', 'arm64', 'mips', | 255 if not arch in ['ia32', 'x64', 'arm', 'armv6', 'armv5te', 'arm64', 'mips', |
| 254 'simdbc', 'simdbc64']: | 256 'simdbc', 'simdbc64']: |
| 255 print ("Cross-compilation to %s is not supported for architecture %s." | 257 print ("Cross-compilation to %s is not supported for architecture %s." |
| 256 % (os_name, arch)) | 258 % (os_name, arch)) |
| 257 return False | 259 return False |
| 258 return True | 260 return True |
| 259 | 261 |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 return 1 | 428 return 1 |
| 427 | 429 |
| 428 endtime = time.time() | 430 endtime = time.time() |
| 429 if args.verbose: | 431 if args.verbose: |
| 430 print ("GN Time: %.3f seconds" % (endtime - starttime)) | 432 print ("GN Time: %.3f seconds" % (endtime - starttime)) |
| 431 return 0 | 433 return 0 |
| 432 | 434 |
| 433 | 435 |
| 434 if __name__ == '__main__': | 436 if __name__ == '__main__': |
| 435 sys.exit(main(sys.argv)) | 437 sys.exit(main(sys.argv)) |
| OLD | NEW |