Commit 79c741fd authored by Raphael Kubo da Costa's avatar Raphael Kubo da Costa Committed by Commit Bot

gn: Add --skip-generate-buildfiles to bootstrap.py

This restores part of --no-rebuild's behavior: we only build GN but do not
run it afterwards when the option is specified. It's particularly useful
when GN is built in a different machine or sysroot than the one where
Chromium itself will be built (often with different dependencies installed
on the system).

Bug: 885139
Change-Id: If9f3386db8324b47b52864bccc685578fd40a689
Reviewed-on: https://chromium-review.googlesource.com/1233708Reviewed-by: default avatarThomas Anderson <thomasanderson@chromium.org>
Commit-Queue: Raphael Kubo da Costa (CET) <raphael.kubo.da.costa@intel.com>
Cr-Commit-Position: refs/heads/master@{#592479}
parent af075dbd
......@@ -51,6 +51,11 @@ def main(argv):
action='store_true',
help='Download and build with the Debian sysroot.')
parser.add_option('-v', '--verbose', help='ignored')
parser.add_option(
'--skip-generate-buildfiles',
action='store_true',
help='Do not run GN after building it. Causes --gn-gen-args '
'to have no effect.')
options, args = parser.parse_args(argv)
if args:
parser.error('Unrecognized command line arguments: %s.' % ', '.join(args))
......@@ -83,13 +88,14 @@ def main(argv):
['ninja', '-C', gn_build_dir, 'gn', '-w', 'dupbuild=err'])
shutil.copy2(os.path.join(gn_build_dir, 'gn'), gn_path)
gn_gen_args = options.gn_gen_args or ''
if not options.debug:
gn_gen_args += ' is_debug=false'
subprocess.check_call([
gn_path, 'gen', out_dir,
'--args=%s' % gn_gen_args, "--root=" + SRC_ROOT
])
if not options.skip_generate_buildfiles:
gn_gen_args = options.gn_gen_args or ''
if not options.debug:
gn_gen_args += ' is_debug=false'
subprocess.check_call([
gn_path, 'gen', out_dir,
'--args=%s' % gn_gen_args, "--root=" + SRC_ROOT
])
if __name__ == '__main__':
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment