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

Side by Side Diff: tools/gn.py

Issue 2645323002: Add support for configurable -OX optimization levels for debug builds (Closed)
Patch Set: Move --debug-opt-level after --no-clang in tools/gn.py Created 3 years, 10 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 | « runtime/BUILD.gn ('k') | no next file » | 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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
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')
312 other_group.add_argument('--no-clang', 316 other_group.add_argument('--no-clang',
313 help='Disable Clang', 317 help='Disable Clang',
314 dest='clang', 318 dest='clang',
315 action='store_false') 319 action='store_false')
320 other_group.add_argument('--debug-opt-level',
321 '-d',
322 help='The optimization level to use for debug builds',
323 type=str)
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',
322 dest='goma', 330 dest='goma',
323 action='store_false') 331 action='store_false')
324 other_group.add_argument('--ide', 332 other_group.add_argument('--ide',
325 help='Generate an IDE file.', 333 help='Generate an IDE file.',
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
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))
OLDNEW
« no previous file with comments | « runtime/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698