Index: build/gyp_chromium |
diff --git a/build/gyp_chromium b/build/gyp_chromium |
index c1de890e6721580b5fa19206622628ef70674fa5..2a9d0601e32b6266e36bf4b86206ad5b5a174cd4 100755 |
--- a/build/gyp_chromium |
+++ b/build/gyp_chromium |
@@ -330,6 +330,14 @@ def RunGN(vars_dict): |
return subprocess.call(args) == 0 |
+def GetDesiredVsToolchainHashes(): |
+ """Load a list of SHA1s corresponding to the toolchains that we want installed |
+ to build with.""" |
+ sha1path = os.path.join(script_dir, 'toolchain_vs2013.hash') |
+ with open(sha1path, 'rb') as f: |
+ return f.read().strip().splitlines() |
+ |
+ |
def CopyVsRuntimeDlls(output_dir, runtime_dirs): |
"""Copies the VS runtime DLLs from the given |runtime_dirs| to the output |
directory so that even if not system-installed, built binaries are likely to |
@@ -438,15 +446,28 @@ if __name__ == '__main__': |
not 'OS=ios' in os.environ.get('GYP_DEFINES', []): |
os.environ['GYP_GENERATORS'] = 'ninja' |
- # If on windows, and the automatic toolchain has been installed by |
- # depot_tools, then use it. |
+ # If on Windows, request that depot_tools install/update the automatic |
+ # toolchain, and then use it (unless opted-out). |
vs2013_runtime_dll_dirs = None |
- # If MSVS_VERSION is explicitly specified to be something other than 2013, |
- # don't use the automatic toolchain, as it currently only supports VS2013. |
- msvs_version = os.environ.get('GYP_MSVS_VERSION', '2013') |
- if sys.platform in ('win32', 'cygwin') and msvs_version.startswith('2013'): |
+ depot_tools_win_toolchain = \ |
+ bool(int(os.environ.get('DEPOT_TOOLS_WIN_TOOLCHAIN', '1'))) |
+ if sys.platform in ('win32', 'cygwin') and depot_tools_win_toolchain: |
import find_depot_tools |
depot_tools_path = find_depot_tools.add_depot_tools_to_path() |
+ get_toolchain_args = [ |
+ sys.executable, |
+ os.path.join(depot_tools_path, |
+ 'win_toolchain', |
+ 'get_toolchain_if_necessary.py'), |
+ ] |
+ get_toolchain_args.extend(GetDesiredVsToolchainHashes()) |
iannucci
2014/02/21 23:56:14
the + operator works too :P
scottmg
2014/02/22 00:10:43
maruel always asks for + -> extend/append. Geez, C
|
+ subprocess.check_call(get_toolchain_args) |
+ |
+ # TODO(scottmg): This should point at vs2013_files/<sha1> so that we can |
+ # have multiple versions concurrently. This is slightly complicated at the |
+ # moment because the downloader script doesn't know the SHA1 of the |
+ # toolchain that it's downloading, so only supports having one 'installed' |
+ # at a time. |
iannucci
2014/02/21 23:56:14
We should probably have the depot tools thing prin
scottmg
2014/02/22 00:10:43
This seems better, except it's a somewhat long pro
|
toolchain = os.path.normpath(os.path.join( |
depot_tools_path, 'win_toolchain', 'vs2013_files')) |
version_file = os.path.join(toolchain, '.version') |