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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
198 if args.goma and goma_dir: | 198 if args.goma and goma_dir: |
199 gn_args['use_goma'] = True | 199 gn_args['use_goma'] = True |
200 gn_args['goma_dir'] = goma_dir | 200 gn_args['goma_dir'] = goma_dir |
201 elif args.goma and os.path.exists(goma_home_dir): | 201 elif args.goma and os.path.exists(goma_home_dir): |
202 gn_args['use_goma'] = True | 202 gn_args['use_goma'] = True |
203 gn_args['goma_dir'] = goma_home_dir | 203 gn_args['goma_dir'] = goma_home_dir |
204 else: | 204 else: |
205 gn_args['use_goma'] = False | 205 gn_args['use_goma'] = False |
206 gn_args['goma_dir'] = None | 206 gn_args['goma_dir'] = None |
207 | 207 |
208 if args.debug_opt_level: | |
209 gn_args['dart_debug_optimization_level'] = args.debug_opt_level | |
210 gn_args['debug_optimization_level'] = args.debug_opt_level | |
211 | |
208 return gn_args | 212 return gn_args |
209 | 213 |
210 | 214 |
211 def process_os_option(os_name): | 215 def process_os_option(os_name): |
212 if os_name == 'host': | 216 if os_name == 'host': |
213 return HOST_OS | 217 return HOST_OS |
214 return os_name | 218 return os_name |
215 | 219 |
216 | 220 |
217 def process_options(args): | 221 def process_options(args): |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
302 default=use_asan(), | 306 default=use_asan(), |
303 action='store_true') | 307 action='store_true') |
304 other_group.add_argument('--no-asan', | 308 other_group.add_argument('--no-asan', |
305 help='Disable ASAN', | 309 help='Disable ASAN', |
306 dest='asan', | 310 dest='asan', |
307 action='store_false') | 311 action='store_false') |
308 other_group.add_argument('--clang', | 312 other_group.add_argument('--clang', |
309 help='Use Clang', | 313 help='Use Clang', |
310 default=True, | 314 default=True, |
311 action='store_true') | 315 action='store_true') |
316 other_group.add_argument('--debug-opt-level', | |
zra
2017/01/24 16:00:36
Let's leave --clang and --no-clang adjacent, and m
kustermann
2017/01/24 16:36:18
Done.
| |
317 '-d', | |
318 help='The optimization level to use for debug builds', | |
319 type=str) | |
312 other_group.add_argument('--no-clang', | 320 other_group.add_argument('--no-clang', |
313 help='Disable Clang', | 321 help='Disable Clang', |
314 dest='clang', | 322 dest='clang', |
315 action='store_false') | 323 action='store_false') |
316 other_group.add_argument('--goma', | 324 other_group.add_argument('--goma', |
317 help='Use goma', | 325 help='Use goma', |
318 default=True, | 326 default=True, |
319 action='store_true') | 327 action='store_true') |
320 other_group.add_argument('--no-goma', | 328 other_group.add_argument('--no-goma', |
321 help='Disable goma', | 329 help='Disable goma', |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
419 return 1 | 427 return 1 |
420 | 428 |
421 endtime = time.time() | 429 endtime = time.time() |
422 if args.verbose: | 430 if args.verbose: |
423 print ("GN Time: %.3f seconds" % (endtime - starttime)) | 431 print ("GN Time: %.3f seconds" % (endtime - starttime)) |
424 return 0 | 432 return 0 |
425 | 433 |
426 | 434 |
427 if __name__ == '__main__': | 435 if __name__ == '__main__': |
428 sys.exit(main(sys.argv)) | 436 sys.exit(main(sys.argv)) |
OLD | NEW |