Commit 68f2e520 authored by Andrew Grieve's avatar Andrew Grieve Committed by Commit Bot

build_gn.py: Forward BUNDLED_WIN_TOOLCHAIN_ROOT

And tweak --depot-tools to go first on PATH

Change-Id: Iee53d84fd028ac0c2de6f872184cbce51e84c54f
Reviewed-on: https://chromium-review.googlesource.com/1028210Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Commit-Queue: agrieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52788}
parent 5ef33ea5
......@@ -103,6 +103,8 @@ def ParseOptions(args):
parser.add_argument("--host_os", help="Current operating system")
parser.add_argument("--bundled-win-toolchain",
help="Value for DEPOT_TOOLS_WIN_TOOLCHAIN")
parser.add_argument("--bundled-win-toolchain-root",
help="Value for DEPOT_TOOLS_WIN_TOOLCHAIN_ROOT")
parser.add_argument("--depot-tools", help="Absolute path to depot_tools")
parser.add_argument("--extra-gn-args", help="Additional GN args")
parser.add_argument("--build", help="Run ninja as opposed to gn gen.",
......@@ -127,8 +129,14 @@ if __name__ == "__main__":
options = ParseOptions(sys.argv[1:])
# Build can result in running gn gen, so need to set environment variables
# for build as well as generate.
os.environ['DEPOT_TOOLS_WIN_TOOLCHAIN'] = options.bundled_win_toolchain
os.environ['PATH'] += os.path.pathsep + options.depot_tools
if options.bundled_win_toolchain:
os.environ['DEPOT_TOOLS_WIN_TOOLCHAIN'] = options.bundled_win_toolchain
if options.bundled_win_toolchain_root:
os.environ['DEPOT_TOOLS_WIN_TOOLCHAIN_ROOT'] = (
options.bundled_win_toolchain_root)
if options.depot_tools:
os.environ['PATH'] = (
options.depot_tools + os.path.pathsep + os.environ['PATH'])
if not options.build:
GenerateBuildFiles(options)
else:
......
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