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

Side by Side Diff: tools/gn.py

Issue 2397623003: Run GN from build.py if the output directory doesn't exist (Closed)
Patch Set: Created 4 years, 2 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') | 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 gn_args['is_debug'] = mode == 'debug' 92 gn_args['is_debug'] = mode == 'debug'
93 gn_args['is_release'] = mode == 'release' 93 gn_args['is_release'] = mode == 'release'
94 gn_args['is_product'] = mode == 'product' 94 gn_args['is_product'] = mode == 'product'
95 gn_args['dart_debug'] = mode == 'debug' 95 gn_args['dart_debug'] = mode == 'debug'
96 96
97 # This setting is only meaningful for Flutter. Standalone builds of the VM 97 # This setting is only meaningful for Flutter. Standalone builds of the VM
98 # should leave this set to 'develop', which causes the build to defer to 98 # should leave this set to 'develop', which causes the build to defer to
99 # 'is_debug', 'is_release' and 'is_product'. 99 # 'is_debug', 'is_release' and 'is_product'.
100 gn_args['dart_runtime_mode'] = 'develop' 100 gn_args['dart_runtime_mode'] = 'develop'
101 101
102 if host_os == 'win': 102 # TODO(zra): Investigate using clang with these configurations.
103 gn_args['is_clang'] = False 103 has_clang = (host_os != 'win'
104 else: 104 and args.os not in ['android']
105 gn_args['is_clang'] = args.clang and args.os not in ['android'] 105 and not gn_args['target_cpu'].startswith('arm')
106 and not gn_args['target_cpu'].startswith('mips'))
107 gn_args['is_clang'] = args.clang and has_clang
106 108
107 if args.target_sysroot: 109 if args.target_sysroot:
108 gn_args['target_sysroot'] = args.target_sysroot 110 gn_args['target_sysroot'] = args.target_sysroot
109 111
110 if args.toolchain_prefix: 112 if args.toolchain_prefix:
111 gn_args['toolchain_prefix'] = args.toolchain_prefix 113 gn_args['toolchain_prefix'] = args.toolchain_prefix
112 114
113 goma_dir = os.environ.get('GOMA_DIR') 115 goma_dir = os.environ.get('GOMA_DIR')
114 goma_home_dir = os.path.join(os.getenv('HOME', ''), 'goma') 116 goma_home_dir = os.path.join(os.getenv('HOME', ''), 'goma')
115 if args.goma and goma_dir: 117 if args.goma and goma_dir:
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 276
275 pool = multiprocessing.Pool(args.workers) 277 pool = multiprocessing.Pool(args.workers)
276 results = pool.map(run_command, commands, chunksize=1) 278 results = pool.map(run_command, commands, chunksize=1)
277 for r in results: 279 for r in results:
278 if r != 0: 280 if r != 0:
279 print r.strip() 281 print r.strip()
280 return 1 282 return 1
281 283
282 endtime = time.time() 284 endtime = time.time()
283 if args.verbose: 285 if args.verbose:
284 print "GN Time: " + str(endtime - starttime) + " seconds" 286 print ("GN Time: %.3f seconds" % (endtime - starttime))
285 return 0 287 return 0
286 288
287 289
288 if __name__ == '__main__': 290 if __name__ == '__main__':
289 sys.exit(main(sys.argv)) 291 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « tools/build.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698