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

Unified Diff: build/toolchain/win/setup_toolchain.py

Issue 951673002: Revert "Pull chromium at 2c3ffb2355a27c32f45e508ef861416b820c823b" (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/toolchain/win/midl.gni ('k') | build/vs_toolchain.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/toolchain/win/setup_toolchain.py
diff --git a/build/toolchain/win/setup_toolchain.py b/build/toolchain/win/setup_toolchain.py
index bc9bd1e7b43bf6fe65f5c34f36ac37aa71442c25..cc89638e19e83657f168d4b9303e5a295519edc2 100644
--- a/build/toolchain/win/setup_toolchain.py
+++ b/build/toolchain/win/setup_toolchain.py
@@ -51,23 +51,23 @@ def _ExtractImportantEnvironment(output_of_set):
return env
-def _SetupScript(target_cpu, sdk_dir):
+def _SetupScript(target_arch, sdk_dir):
"""Returns a command (with arguments) to be used to set up the
environment."""
# Check if we are running in the SDK command line environment and use
- # the setup script from the SDK if so. |target_cpu| should be either
+ # the setup script from the SDK if so. |target_arch| should be either
# 'x86' or 'x64'.
- assert target_cpu in ('x86', 'x64')
+ assert target_arch in ('x86', 'x64')
if bool(int(os.environ.get('DEPOT_TOOLS_WIN_TOOLCHAIN', 1))) and sdk_dir:
return [os.path.normpath(os.path.join(sdk_dir, 'Bin/SetEnv.Cmd')),
- '/' + target_cpu]
+ '/' + target_arch]
else:
# We only support x64-hosted tools.
# TODO(scottmg|dpranke): Non-depot_tools toolchain: need to get Visual
# Studio install location from registry.
return [os.path.normpath(os.path.join(os.environ['GYP_MSVS_OVERRIDE_PATH'],
'VC/vcvarsall.bat')),
- 'amd64_x86' if target_cpu == 'x86' else 'amd64']
+ 'amd64_x86' if target_arch == 'x86' else 'amd64']
def _FormatAsEnvironmentBlock(envvar_dict):
@@ -100,25 +100,25 @@ def main():
if len(sys.argv) != 6:
print('Usage setup_toolchain.py '
'<visual studio path> <win tool path> <win sdk path> '
- '<runtime dirs> <target_cpu>')
+ '<runtime dirs> <cpu_arch>')
sys.exit(2)
tool_source = sys.argv[2]
win_sdk_path = sys.argv[3]
runtime_dirs = sys.argv[4]
- target_cpu = sys.argv[5]
+ cpu_arch = sys.argv[5]
_CopyTool(tool_source)
- cpus = ('x86', 'x64')
- assert target_cpu in cpus
+ archs = ('x86', 'x64')
+ assert cpu_arch in archs
vc_bin_dir = ''
# TODO(scottmg|goma): Do we need an equivalent of
# ninja_use_custom_environment_files?
- for cpu in cpus:
+ for arch in archs:
# Extract environment variables for subprocesses.
- args = _SetupScript(cpu, win_sdk_path)
+ args = _SetupScript(arch, win_sdk_path)
args.extend(('&&', 'set'))
popen = subprocess.Popen(
args, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
@@ -126,7 +126,7 @@ def main():
env = _ExtractImportantEnvironment(variables)
env['PATH'] = runtime_dirs + ';' + env['PATH']
- if cpu == target_cpu:
+ if arch == cpu_arch:
for path in env['PATH'].split(os.pathsep):
if os.path.exists(os.path.join(path, 'cl.exe')):
vc_bin_dir = os.path.realpath(path)
@@ -143,7 +143,7 @@ def main():
sdk_dir=win_sdk_path)
env['INCLUDE'] = additional_includes + env['INCLUDE']
env_block = _FormatAsEnvironmentBlock(env)
- with open('environment.' + cpu, 'wb') as f:
+ with open('environment.' + arch, 'wb') as f:
f.write(env_block)
assert vc_bin_dir
« no previous file with comments | « build/toolchain/win/midl.gni ('k') | build/vs_toolchain.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698