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

Unified Diff: tools/clang/scripts/update.py

Issue 587383003: Make Clang's update.py use the Win toolchain under depot_tools if available (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Import vs_toolchain.py Created 6 years, 3 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 | « DEPS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/clang/scripts/update.py
diff --git a/tools/clang/scripts/update.py b/tools/clang/scripts/update.py
index af3df5aac680307b3721420e6e7a0e49d9a2958d..8f5cc9c1c499f0b68562dcd774b2044511714541 100755
--- a/tools/clang/scripts/update.py
+++ b/tools/clang/scripts/update.py
@@ -6,6 +6,7 @@
"""Windows can't run .sh files, so this is a Python implementation of
update.sh. This script should replace update.sh on all platforms eventually."""
+import json
scottmg 2014/09/22 19:54:51 unneeded now
import os
import re
import shutil
@@ -136,13 +137,20 @@ def AddCMakeToPath():
vs_version = None
def GetVSVersion():
global vs_version
- if not vs_version:
- # TODO(hans): Find a less hacky way to find the MSVS installation.
- sys.path.append(os.path.join(CHROMIUM_DIR, 'tools', 'gyp', 'pylib'))
- import gyp.MSVSVersion
- # We request VS 2013 because Clang won't build with 2010, and 2013 will be
- # the default for Chromium soon anyway.
- vs_version = gyp.MSVSVersion.SelectVisualStudioVersion('2013')
+ if vs_version:
+ return vs_version
+
+ # Try using the toolchain in depot_tools.
+ # This sets environment variables used by SelectVisualStudioVersion below.
+ sys.path.append(os.path.join(CHROMIUM_DIR, 'build'))
+ import vs_toolchain
+ vs_toolchain.SetEnvironmentAndGetRuntimeDllDirs()
+
+ # Use gyp to find the MSVS installation, either in depot_tools as per above,
+ # or a system-wide installation otherwise.
+ sys.path.append(os.path.join(CHROMIUM_DIR, 'tools', 'gyp', 'pylib'))
+ import gyp.MSVSVersion
+ vs_version = gyp.MSVSVersion.SelectVisualStudioVersion('2013')
return vs_version
« no previous file with comments | « DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698