microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
22.81k stars 6.3k forks source link

version MSVC toolsets in Visual Studio 2017 [-,+] #3147

Closed MVoz closed 6 years ago

MVoz commented 6 years ago

https://blogs.msdn.microsoft.com/vcblog/2017/11/15/side-by-side-minor-version-msvc-toolsets-in-visual-studio-2017/

VS2015 and updates 1, 2, & 3 | v140 in VS; version 14.00 | 1900 VS2017, version 15.1 & 15.2 | v141 in VS; version 14.10 | 1910 VS2017, version 15.3 & 15.4 | v141 in VS; version 14.11 | 1911 VS2017, version 15.5 | v141 in VS; version 14.12 | 1912

решил поставить последнюю версию VS v15.7.0-pre.2.0, для сборки folly
vcpkg ее не находит почему то, но это другой вопрос
собственно, пора видимо расширить выбор\версию компилятора

> decided to put the latest version of VS v15.7.0-pre.2.0, to build folly vcpkg it does not find why, but that's another question actually, it's probably time to expand the choice \ version of the compiler

`%comspec% /k "C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\Common7\Tools\VsDevCmd.bat" -help`

Visual Studio "15" Developer Command Prompt Help ** Version :

Syntax: vsdevcmd.bat [options] [options] : -arch=architecture : Architecture for compiled binaries/libraries x86 [default] amd64 arm arm64 -host_arch=architecture : Architecture of compiler binaries x86 [default] amd64 -winsdk=version : Version of Windows SDK to select. 10.0.xxyyzz.0 : Windows 10 SDK (e.g 10.0.10240.0) [default : Latest Windows 10 SDK] 8.1 : Windows 8.1 SDK none : Do not setup Windows SDK variables. For use with build systems that prefer to determine Windows SDK version independently. -app_platform=platform : Application Platform Target Type. Desktop : Classic Win32 Apps [default] UWP : Universal Windows Platform Apps -no_ext : Only scripts from [VS150COMNTOOLS]\VsDevCmd\Core directory are run during initialization. -no_logo : Suppress printing of the developer command prompt banner. -vcvars_ver=version : Version of VC++ Toolset to select [Default] : If -vcvars_ver=version is NOT specified, the toolset specified by [VSInstallDir]\VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt will be used. 14.0 : VS 2015 (v140) VC++ Toolset (installation of the v140 toolset is a prerequisite) 14.1x : VS 2017 (v141) VC++ Toolset, if that version is installed on the system under [VSInstallDir]\VC\MSVC\Tools[version]. Where '14.1x' specifies a partial [version]. The latest [version] directory that matches the specified value will be used. 14.1x.yyyyy : VS 2017 (v141) VC++ Toolset, if that version is installed on the system under [VSInstallDir]\VC\MSVC\Tools[version]. Where '14.1x.yyyyy' specifies an exact [version] directory to be used. -startdir=mode : configures the current directory after (successful) initialization of the environment. none : the command prompt will exist in the same current directory as when invoked auto : the command prompt will search for [USERPROFILE]\Source and will change directory if it exists. If -startdir=mode is not provided, the developer command prompt scripts will additionally check for the [VSCMD_START_DIR] environment variable. If not specified, the default behavior will be 'none' mode. -test : Run smoke tests to verify environment integrity in an already-initialized command prompt. Executing with -test will NOT modify the environment, so it must be used in a separate call to vsdevcmd.bat (all other parameters should be the same as when the environment was initialied) -help : prints this help message.


> %comspec% /k "C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\Common7\Tools\VsDevCmd.bat" -vcvars_ver=14.14.26316 -arch=amd64 -host_arch=amd64 -winsdk=10.0.15063.0

ок

`-vcvars_ver=14.14.26316`

C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\VC\Tools\MSVC>dir 14.11.25503 14.12.25827 14.14.26316

C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC>ls 14.10.24629
14.10.25017
14.11.25503
14.12.25827


> %comspec% /k "C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\Common7\Tools\VsDevCmd.bat" -vcvars_ver=14.12 -arch=amd64 -host_arch=amd64 -winsdk=10.0.15063.0

ok
`-vcvars_ver=14.12`

C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\VC\Auxiliary\Build>dir 14.11 14.12


**может стоить расшить функцию toolset's ?**

> can it cost to expand the toolset's function?

`set(VCPKG_PLATFORM_TOOLSET v141)` -->>
set(VCPKG_PLATFORM_TOOLSET v1412)
set(VCPKG_PLATFORM_TOOLSET v1411)
set(VCPKG_PLATFORM_TOOLSET 14.14.26316)
MVoz commented 6 years ago

хотя, зачем перегружать код, нашел решение проще, по умолчанию MSVC задается в этом файле Microsoft.VCToolsVersion.default.txt << -->> 14.14.26316 по пути C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\VC\Auxiliary\Build

MVoz commented 6 years ago

в последней версии на момент написания, изменились файлы настройки, расположение все то же

C:\Program Files (x86)\Microsoft Visual Studio\2017\...\VC\Auxiliary\Build

edit file Microsoft.VCToolsVersion.default.props = toolset \ toolchain = C:\Program Files (x86)\Microsoft Visual Studio\2017\...\VC\Tools\MSVC

edit file Microsoft.VCRedistVersion.default.props = Redist = C:\Program Files (x86)\Microsoft Visual Studio\2017\...\VC\Redist\MSVC