diff --git a/build/toolchain/win/setup_toolchain.py b/build/toolchain/win/setup_toolchain.py index 53fac69229a272..fa31688f36a221 100644 --- a/build/toolchain/win/setup_toolchain.py +++ b/build/toolchain/win/setup_toolchain.py @@ -69,7 +69,7 @@ def _ExtractImportantEnvironment(output_of_set): def _DetectVisualStudioPath(): - """Return path to the GYP_MSVS_VERSION of Visual Studio. + """Return path to the installed Visual Studio. """ # Use the code in build/vs_toolchain.py to avoid duplicating code. diff --git a/build/vs_toolchain.py b/build/vs_toolchain.py index b9505ec624d6d3..9db0ea456f8758 100755 --- a/build/vs_toolchain.py +++ b/build/vs_toolchain.py @@ -82,7 +82,6 @@ def SetEnvironmentAndGetRuntimeDllDirs(): vs_runtime_dll_dirs.append('Arm64Unused') os.environ['GYP_MSVS_OVERRIDE_PATH'] = toolchain - os.environ['GYP_MSVS_VERSION'] = version os.environ['WINDOWSSDKDIR'] = win_sdk os.environ['WDK_DIR'] = wdk @@ -92,8 +91,6 @@ def SetEnvironmentAndGetRuntimeDllDirs(): elif sys.platform == 'win32' and not depot_tools_win_toolchain: if not 'GYP_MSVS_OVERRIDE_PATH' in os.environ: os.environ['GYP_MSVS_OVERRIDE_PATH'] = DetectVisualStudioPath() - if not 'GYP_MSVS_VERSION' in os.environ: - os.environ['GYP_MSVS_VERSION'] = GetVisualStudioVersion() # When using an installed toolchain these files aren't needed in the output # directory in order to run binaries locally, but they are needed in order @@ -143,11 +140,6 @@ def _RegistryGetValue(key, value): def GetVisualStudioVersion(): """Return best available version of Visual Studio. """ - - env_version = os.environ.get('GYP_MSVS_VERSION') - if env_version: - return env_version - supported_versions = MSVS_VERSIONS.keys() # VS installed in depot_tools for Googlers @@ -175,7 +167,7 @@ def GetVisualStudioVersion(): def DetectVisualStudioPath(): - """Return path to the GYP_MSVS_VERSION of Visual Studio. + """Return path to the installed Visual Studio. """ # Note that this code is used from @@ -203,8 +195,7 @@ def DetectVisualStudioPath(): if path and os.path.exists(path): return path - raise Exception('Visual Studio Version %s (from GYP_MSVS_VERSION)' - ' not found.' % version_as_year) + raise Exception('Visual Studio Version %s not found.' % version_as_year) def _CopyRuntimeImpl(target, source, verbose=True): @@ -500,9 +491,6 @@ def Update(force=False, no_download=False): subprocess.check_call([ ciopfs, '-o', 'use_ino', toolchain_dir + '.ciopfs', toolchain_dir]) - # Necessary so that get_toolchain_if_necessary.py will put the VS toolkit - # in the correct directory. - os.environ['GYP_MSVS_VERSION'] = GetVisualStudioVersion() get_toolchain_args = [ sys.executable, os.path.join(depot_tools_path, diff --git a/docs/windows_build_instructions.md b/docs/windows_build_instructions.md index e496e715d95a9f..8845f8484cce73 100644 --- a/docs/windows_build_instructions.md +++ b/docs/windows_build_instructions.md @@ -88,9 +88,7 @@ if your system PATH has a Python in it, you will be out of luck. Also, add a DEPOT_TOOLS_WIN_TOOLCHAIN system variable in the same way, and set it to 0. This tells depot_tools to use your locally installed version of Visual -Studio (by default, depot_tools will try to use a google-internal version). If -you want to build with Visual Studio 2017 instead of Visual Studio 2019 (the -default) then set the GYP_MSVS_VERSION environment variable to 2017. +Studio (by default, depot_tools will try to use a google-internal version). From a cmd.exe shell, run the command gclient (without arguments). On first run, gclient will install all the Windows-specific bits needed to work with @@ -168,7 +166,8 @@ $ gn gen out/Default update the build files as needed. * You can replace `Default` with another name, but it should be a subdirectory of `out`. -* For other build arguments, including release settings, see [GN build +* For other build arguments, including release settings or using an alternate + version of Visual Studio, see [GN build configuration](https://www.chromium.org/developers/gn-build-configuration). The default will be a debug component build matching the current host operating system and CPU. diff --git a/tools/win/setenv.bat b/tools/win/setenv.bat index f85480b77d45f6..ce0cc41cc9102e 100755 --- a/tools/win/setenv.bat +++ b/tools/win/setenv.bat @@ -5,7 +5,7 @@ REM Use of this source code is governed by a BSD-style license that can be REM found in the LICENSE file. REM Run this script to add the current toolchain, as determined by -REM GYP_MSVS_VERSION, DEPOT_TOOLS_WIN_TOOLCHAIN and the hash in vs_toolchain.py, +REM DEPOT_TOOLS_WIN_TOOLCHAIN and the hash in vs_toolchain.py, REM to the path. Be aware of running this multiple times as too-long paths will REM break things. REM To get the toolchain for x64 targets pass /x64 to this batch file.