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

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

Issue 738333002: Make goma work on win GN builds. (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: reformat w/ tip-of-tree gn Created 6 years 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/BUILD.gn ('k') | no next file » | 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 42c3af1b6cd7e65d3e0641d680ecc9162952cbe1..6b7ea7a5116f8fcf38064f3dd73e320144cbf60b 100644
--- a/build/toolchain/win/setup_toolchain.py
+++ b/build/toolchain/win/setup_toolchain.py
@@ -98,20 +98,26 @@ def _CopyTool(source_path):
def main():
- if len(sys.argv) != 5:
+ if len(sys.argv) != 6:
print('Usage setup_toolchain.py '
- '<visual studio path> <win tool path> <win sdk path> <runtime dirs>')
+ '<visual studio path> <win tool path> <win sdk path> '
+ '<runtime dirs> <cpu_arch>')
sys.exit(2)
vs_path = sys.argv[1]
tool_source = sys.argv[2]
win_sdk_path = sys.argv[3]
runtime_dirs = sys.argv[4]
+ cpu_arch = sys.argv[5]
_CopyTool(tool_source)
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 arch in archs:
# Extract environment variables for subprocesses.
args = _SetupScript(arch, win_sdk_path)
@@ -122,6 +128,12 @@ def main():
env = _ExtractImportantEnvironment(variables)
env['PATH'] = runtime_dirs + ';' + env['PATH']
+ 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)
+ break
+
# TODO(scottmg|thakis|dpranke): Is there an equivalent to
# msvs_system_include_dirs that we need to inject into INCLUDE here?
@@ -129,6 +141,9 @@ def main():
with open('environment.' + arch, 'wb') as f:
f.write(env_block)
+ assert vc_bin_dir
+ print 'vc_bin_dir = "%s"' % vc_bin_dir
+
if __name__ == '__main__':
main()
« no previous file with comments | « build/toolchain/win/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698