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

Side by Side Diff: tools/gn.py

Issue 2596333002: GN: Fix armsimdbc target. Add armsimdbc64 (Closed)
Patch Set: Created 3 years, 12 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
« no previous file with comments | « tools/build.py ('k') | tools/utils.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 13 matching lines...) Expand all
24 def to_command_line(gn_args): 24 def to_command_line(gn_args):
25 def merge(key, value): 25 def merge(key, value):
26 if type(value) is bool: 26 if type(value) is bool:
27 return '%s=%s' % (key, 'true' if value else 'false') 27 return '%s=%s' % (key, 'true' if value else 'false')
28 return '%s="%s"' % (key, value) 28 return '%s="%s"' % (key, value)
29 return [merge(x, y) for x, y in gn_args.iteritems()] 29 return [merge(x, y) for x, y in gn_args.iteritems()]
30 30
31 31
32 def host_cpu_for_arch(arch): 32 def host_cpu_for_arch(arch):
33 if arch in ['ia32', 'arm', 'armv6', 'armv5te', 'mips', 33 if arch in ['ia32', 'arm', 'armv6', 'armv5te', 'mips',
34 'simarm', 'simarmv6', 'simarmv5te', 'simmips', 'simdbc']: 34 'simarm', 'simarmv6', 'simarmv5te', 'simmips', 'simdbc',
35 'armsimdbc']:
35 return 'x86' 36 return 'x86'
36 if arch in ['x64', 'arm64', 'simarm64', 'simdbc64']: 37 if arch in ['x64', 'arm64', 'simarm64', 'simdbc64', 'armsimdbc64']:
37 return 'x64' 38 return 'x64'
38 39
39 40
40 def target_cpu_for_arch(arch, target_os): 41 def target_cpu_for_arch(arch, target_os):
41 if arch in ['ia32', 'simarm', 'simarmv6', 'simarmv5te', 'simmips']: 42 if arch in ['ia32', 'simarm', 'simarmv6', 'simarmv5te', 'simmips']:
42 return 'x86' 43 return 'x86'
43 if arch in ['simarm64']: 44 if arch in ['simarm64']:
44 return 'x64' 45 return 'x64'
45 if arch == 'mips': 46 if arch == 'mips':
46 return 'mipsel' 47 return 'mipsel'
47 if arch == 'simdbc': 48 if arch == 'simdbc':
48 return 'arm' if target_os == 'android' else 'x86' 49 return 'arm' if target_os == 'android' else 'x86'
49 if arch == 'simdbc64': 50 if arch == 'simdbc64':
50 return 'arm64' if target_os == 'android' else 'x64' 51 return 'arm64' if target_os == 'android' else 'x64'
52 if arch == 'armsimdbc':
53 return 'arm'
54 if arch == 'armsimdbc64':
55 return 'arm64'
51 return arch 56 return arch
52 57
53 58
54 def host_os_for_gn(host_os): 59 def host_os_for_gn(host_os):
55 if host_os.startswith('macos'): 60 if host_os.startswith('macos'):
56 return 'mac' 61 return 'mac'
57 if host_os.startswith('win'): 62 if host_os.startswith('win'):
58 return 'win' 63 return 'win'
59 return host_os 64 return host_os
60 65
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 args.mode = args.mode.split(',') 167 args.mode = args.mode.split(',')
163 args.arch = args.arch.split(',') 168 args.arch = args.arch.split(',')
164 args.os = args.os.split(',') 169 args.os = args.os.split(',')
165 for mode in args.mode: 170 for mode in args.mode:
166 if not mode in ['debug', 'release', 'product']: 171 if not mode in ['debug', 'release', 'product']:
167 print "Unknown mode %s" % mode 172 print "Unknown mode %s" % mode
168 return False 173 return False
169 for arch in args.arch: 174 for arch in args.arch:
170 archs = ['ia32', 'x64', 'simarm', 'arm', 'simarmv6', 'armv6', 175 archs = ['ia32', 'x64', 'simarm', 'arm', 'simarmv6', 'armv6',
171 'simarmv5te', 'armv5te', 'simmips', 'mips', 'simarm64', 'arm64', 176 'simarmv5te', 'armv5te', 'simmips', 'mips', 'simarm64', 'arm64',
172 'simdbc', 'simdbc64', 'armsimdbc'] 177 'simdbc', 'simdbc64', 'armsimdbc', 'armsimdbc64']
173 if not arch in archs: 178 if not arch in archs:
174 print "Unknown arch %s" % arch 179 print "Unknown arch %s" % arch
175 return False 180 return False
176 oses = [process_os_option(os_name) for os_name in args.os] 181 oses = [process_os_option(os_name) for os_name in args.os]
177 for os_name in oses: 182 for os_name in oses:
178 if not os_name in ['android', 'freebsd', 'linux', 'macos', 'win32']: 183 if not os_name in ['android', 'freebsd', 'linux', 'macos', 'win32']:
179 print "Unknown os %s" % os_name 184 print "Unknown os %s" % os_name
180 return False 185 return False
181 if os_name != HOST_OS: 186 if os_name != HOST_OS:
182 if os_name != 'android': 187 if os_name != 'android':
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 return 1 353 return 1
349 354
350 endtime = time.time() 355 endtime = time.time()
351 if args.verbose: 356 if args.verbose:
352 print ("GN Time: %.3f seconds" % (endtime - starttime)) 357 print ("GN Time: %.3f seconds" % (endtime - starttime))
353 return 0 358 return 0
354 359
355 360
356 if __name__ == '__main__': 361 if __name__ == '__main__':
357 sys.exit(main(sys.argv)) 362 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « tools/build.py ('k') | tools/utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698