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): ...@@ -51,6 +51,11 @@ def main(argv):
action='store_true', action='store_true',
help='Download and build with the Debian sysroot.') help='Download and build with the Debian sysroot.')
parser.add_option('-v', '--verbose', help='ignored') 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) options, args = parser.parse_args(argv)
if args: if args:
parser.error('Unrecognized command line arguments: %s.' % ', '.join(args)) parser.error('Unrecognized command line arguments: %s.' % ', '.join(args))
...@@ -83,13 +88,14 @@ def main(argv): ...@@ -83,13 +88,14 @@ def main(argv):
['ninja', '-C', gn_build_dir, 'gn', '-w', 'dupbuild=err']) ['ninja', '-C', gn_build_dir, 'gn', '-w', 'dupbuild=err'])
shutil.copy2(os.path.join(gn_build_dir, 'gn'), gn_path) shutil.copy2(os.path.join(gn_build_dir, 'gn'), gn_path)
gn_gen_args = options.gn_gen_args or '' if not options.skip_generate_buildfiles:
if not options.debug: gn_gen_args = options.gn_gen_args or ''
gn_gen_args += ' is_debug=false' if not options.debug:
subprocess.check_call([ gn_gen_args += ' is_debug=false'
gn_path, 'gen', out_dir, subprocess.check_call([
'--args=%s' % gn_gen_args, "--root=" + SRC_ROOT gn_path, 'gen', out_dir,
]) '--args=%s' % gn_gen_args, "--root=" + SRC_ROOT
])
if __name__ == '__main__': 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