3
3
# Use of this source code is governed by a BSD-style license that can be
4
4
# found in the LICENSE file.
5
5
6
+ from __future__ import absolute_import
7
+ from __future__ import division
8
+ from __future__ import print_function
9
+
6
10
import argparse
7
11
import subprocess
8
12
import sys
@@ -223,6 +227,8 @@ def to_gn_args(args):
223
227
gn_args ['use_goma' ] = True
224
228
gn_args ['goma_dir' ] = depot_tools_bin_dir
225
229
else :
230
+ if args .goma :
231
+ print ("GOMA usage was specified but can't be found, falling back to local builds. Set the GOMA_DIR environment variable to fix GOMA." )
226
232
gn_args ['use_goma' ] = False
227
233
gn_args ['goma_dir' ] = None
228
234
@@ -417,11 +423,11 @@ def main(argv):
417
423
out_dir = get_out_dir (args )
418
424
command .append (out_dir )
419
425
command .append ('--args=%s' % ' ' .join (gn_args ))
420
- print "Generating GN files in: %s" % out_dir
426
+ print ( "Generating GN files in: %s" % out_dir )
421
427
try :
422
428
gn_call_result = subprocess .call (command , cwd = SRC_ROOT )
423
429
except subprocess .CalledProcessError as exc :
424
- print "Failed to generate gn files: " , exc .returncode , exc .output
430
+ print ( "Failed to generate gn files: " , exc .returncode , exc .output )
425
431
sys .exit (1 )
426
432
427
433
if gn_call_result == 0 :
@@ -442,7 +448,7 @@ def main(argv):
442
448
try :
443
449
contents = subprocess .check_output (compile_cmd_gen_cmd , cwd = SRC_ROOT )
444
450
except subprocess .CalledProcessError as exc :
445
- print "Failed to run ninja: " , exc .returncode , exc .output
451
+ print ( "Failed to run ninja: " , exc .returncode , exc .output )
446
452
sys .exit (1 )
447
453
compile_commands = open ('%s/out/compile_commands.json' % SRC_ROOT , 'w+' )
448
454
compile_commands .write (contents )
0 commit comments