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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 if args.goma and goma_dir: | 195 if args.goma and goma_dir: |
196 gn_args['use_goma'] = True | 196 gn_args['use_goma'] = True |
197 gn_args['goma_dir'] = goma_dir | 197 gn_args['goma_dir'] = goma_dir |
198 elif args.goma and os.path.exists(goma_home_dir): | 198 elif args.goma and os.path.exists(goma_home_dir): |
199 gn_args['use_goma'] = True | 199 gn_args['use_goma'] = True |
200 gn_args['goma_dir'] = goma_home_dir | 200 gn_args['goma_dir'] = goma_home_dir |
201 else: | 201 else: |
202 gn_args['use_goma'] = False | 202 gn_args['use_goma'] = False |
203 gn_args['goma_dir'] = None | 203 gn_args['goma_dir'] = None |
204 | 204 |
| 205 gn_args['dart_debug_optimization_level'] = args.debug_opt_level |
| 206 |
205 return gn_args | 207 return gn_args |
206 | 208 |
207 | 209 |
208 def process_os_option(os_name): | 210 def process_os_option(os_name): |
209 if os_name == 'host': | 211 if os_name == 'host': |
210 return HOST_OS | 212 return HOST_OS |
211 return os_name | 213 return os_name |
212 | 214 |
213 | 215 |
214 def process_options(args): | 216 def process_options(args): |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 default=use_asan(), | 301 default=use_asan(), |
300 action='store_true') | 302 action='store_true') |
301 other_group.add_argument('--no-asan', | 303 other_group.add_argument('--no-asan', |
302 help='Disable ASAN', | 304 help='Disable ASAN', |
303 dest='asan', | 305 dest='asan', |
304 action='store_false') | 306 action='store_false') |
305 other_group.add_argument('--clang', | 307 other_group.add_argument('--clang', |
306 help='Use Clang', | 308 help='Use Clang', |
307 default=True, | 309 default=True, |
308 action='store_true') | 310 action='store_true') |
| 311 other_group.add_argument('--debug-opt-level', |
| 312 '-d', |
| 313 help='The optimization level to use for debug builds', |
| 314 type=int, |
| 315 default=2) |
309 other_group.add_argument('--no-clang', | 316 other_group.add_argument('--no-clang', |
310 help='Disable Clang', | 317 help='Disable Clang', |
311 dest='clang', | 318 dest='clang', |
312 action='store_false') | 319 action='store_false') |
313 other_group.add_argument('--goma', | 320 other_group.add_argument('--goma', |
314 help='Use goma', | 321 help='Use goma', |
315 default=True, | 322 default=True, |
316 action='store_true') | 323 action='store_true') |
317 other_group.add_argument('--no-goma', | 324 other_group.add_argument('--no-goma', |
318 help='Disable goma', | 325 help='Disable goma', |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 return 1 | 423 return 1 |
417 | 424 |
418 endtime = time.time() | 425 endtime = time.time() |
419 if args.verbose: | 426 if args.verbose: |
420 print ("GN Time: %.3f seconds" % (endtime - starttime)) | 427 print ("GN Time: %.3f seconds" % (endtime - starttime)) |
421 return 0 | 428 return 0 |
422 | 429 |
423 | 430 |
424 if __name__ == '__main__': | 431 if __name__ == '__main__': |
425 sys.exit(main(sys.argv)) | 432 sys.exit(main(sys.argv)) |
OLD | NEW |