Visual Studio 2022 - Using Specific MSVC Build Tools #1
jcbrill
started this conversation in
Documentation
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This document is generated by markedpp from source document fragments; edits will be lost when the document is regenerated.
Visual Studio 2022 - Using Specific MSVC Build Tools
Preamble - Under Construction.
Executive Summary - Under Construction.
Table of Contents
1. Introduction
Under construction.
2. MSVC Installer Files
Common document definitions as of 18-Feb-2024:
VS2022INSTALLDIR
=C:\Program Files\Microsoft Visual Studio\2022\Community
14.39.33519
14.34.31933
2.1. Batch File Dependencies
Legend:
Optional if the -vcvars_ver argument and MSVC_USER_VERSION environment variable are undefined and the Microsoft.VCToolsVersion.v143.default.txt file exists.
Required when the -vcvars_ver argument and MSVC_USER_VERSION environment variable are undefined and the Microsoft.VCToolsVersion.v143.default.txt file does not exist.
Required when building with the v14.0 build tools. The v14.0 build tools are not installed in the %VS2022INSTALLDIR% folder. The location is found via the windows registry.
Required.
Required that at least one of the two target architecture batch files exists.
2.2. Individual Build Tool Target Architecture Installation
2.2.1. Files Installed
x64/x86
arm
arm64
x64/x86
arm
arm64
File
Path
2.2.2. Version File Contents
x64/x86
arm
arm64
x64/x86
arm
arm64
VCToolsVersion.
default.txt
VCToolsVersion.
v143.default.txt
3. VS 2022 With v14.34 Build Tools by Target Architecture
3.1. Target x64/x86 With v14.34 Build Tools
3.1.1. Installation Steps
New Installation - Workload Method:
VCToolsVersion.
default.txt
VCToolsVersion.
v143.default.txt
[x] Desktop development with C++
[x] MSVC v143 - VS 2022 C++ x64/x86
build tools (v14.34-17.4)
New Installation - Minimal Component Method:
VCToolsVersion.
default.txt
VCToolsVersion.
v143.default.txt
[x] MSVC v143 - VS 2022 C++ x64/x86
build tools (latest)
[x] Windows 11 SDK (10.0.22621.0)
[x] MSVC v143 - VS 2022 C++ x64/x86
build tools (v14.34-17.4)
Existing Installation - x64/x86 Build Tools (v14.34 Only):
VCToolsVersion.
default.txt
VCToolsVersion.
v143.default.txt
[x] MSVC v143 - VS 2022 C++ x64/x86
build tools (v14.34-17.4)
[x] Windows 11 SDK (10.0.22621.0)
[x] MSVC v143 - VS 2022 C++ x64/x86
build tools (latest)
[ ] MSVC v143 - VS 2022 C++ x64/x86
build tools (v14.34-17.4)
[x] MSVC v143 - VS 2022 C++ x64/x86
build tools (v14.34-17.4)
3.1.2. Sample Invocations
SCons environment invocations targeting amd64 and x86:
1 The v14.34 build tools will be used as the default build tools until later VS installer invocations modify or remove Microsoft.VCToolsVersion.v143.default.txt.
Windows command-line invocations targeting amd64 and x86 using amd64 build tools:
-vcvars_ver=14.34
-vcvars_ver=14.34
"%VS2022INSTALLDIR%\VC\Auxiliary\Build\vcvars64.bat"
"%VS2022INSTALLDIR%\VC\Auxiliary\Build\vcvarsamd64_x86.bat"
"%VS2022INSTALLDIR%\VC\Auxiliary\Build\vcvarsall.bat" x64
"%VS2022INSTALLDIR%\VC\Auxiliary\Build\vcvarsall.bat" x64_x86
"%VS2022INSTALLDIR%\Common7\Tools\VsDevCmd.bat" -host_arch=amd64 -arch=amd64
"%VS2022INSTALLDIR%\Common7\Tools\VsDevCmd.bat" -host_arch=amd64 -arch=x86
-vcvars_ver=14.3
-vcvars_ver=14.3
"%VS2022INSTALLDIR%\VC\Auxiliary\Build\vcvars64.bat"
"%VS2022INSTALLDIR%\VC\Auxiliary\Build\vcvarsamd64_x86.bat"
"%VS2022INSTALLDIR%\VC\Auxiliary\Build\vcvarsall.bat" x64
"%VS2022INSTALLDIR%\VC\Auxiliary\Build\vcvarsall.bat" x64_x86
"%VS2022INSTALLDIR%\Common7\Tools\VsDevCmd.bat" -host_arch=amd64 -arch=amd64
"%VS2022INSTALLDIR%\Common7\Tools\VsDevCmd.bat" -host_arch=amd64 -arch=x86
1 The v14.34 build tools will be used as the default build tools until later VS installer invocations modify or remove Microsoft.VCToolsVersion.v143.default.txt.
2 Use of the VCVARS_USER_VERSION environment variable appears to be undocumented.
3.2. Target ARM With v14.34 Build Tools
3.2.1. Installation Steps
New Installation - Workload Method:
VCToolsVersion.
default.txt
VCToolsVersion.
v143.default.txt
[x] Desktop development with C++
Individual Components:
[x] MSVC v143 - VS 2022 C++ ARM
build tools (latest)
[x] MSVC v143 - VS 2022 C++ ARM
build tools (v14.34-17.4)
New Installation - Minimal Component Method:
VCToolsVersion.
default.txt
VCToolsVersion.
v143.default.txt
[x] MSVC v143 - VS 2022 C++ ARM
build tools (latest)
[x] MSVC v143 - VS 2022 C++ x64/x86
build tools (latest)
[x] Windows 11 SDK (10.0.22621.0)
[x] MSVC v143 - VS 2022 C++ ARM
build tools (v14.34-17.4)
Existing Installation - ARM Build Tools (v14.34 Only):
VCToolsVersion.
default.txt
VCToolsVersion.
v143.default.txt
[x] MSVC v143 - VS 2022 ARM
build tools (v14.34-17.4)
[x] Windows 11 SDK (10.0.22621.0)
[x] MSVC v143 - VS 2022 C++ ARM
build tools (latest)
[ ] MSVC v143 - VS 2022 C++ ARM
build tools (v14.34-17.4)
[x] MSVC v143 - VS 2022 C++ x64/x86
build tools (latest)
[x] MSVC v143 - VS 2022 C++ ARM
build tools (v14.34-17.4)
3.2.2. Sample Invocations
SCons environment invocations targeting ARM:
1 The v14.34 build tools will be used as the default build tools until later VS installer invocations modify or remove Microsoft.VCToolsVersion.v143.default.txt.
Windows command-line invocations targeting ARM using amd64 build tools:
-vcvars_ver=14.34
"%VS2022INSTALLDIR%\VC\Auxiliary\Build\vcvarsamd64_arm.bat"
"%VS2022INSTALLDIR%\VC\Auxiliary\Build\vcvarsall.bat" x64_arm
"%VS2022INSTALLDIR%\Common7\Tools\VsDevCmd.bat" -host_arch=amd64 -arch=arm
-vcvars_ver=14.3
"%VS2022INSTALLDIR%\VC\Auxiliary\Build\vcvarsamd64_arm.bat"
"%VS2022INSTALLDIR%\VC\Auxiliary\Build\vcvarsall.bat" x64_arm
"%VS2022INSTALLDIR%\Common7\Tools\VsDevCmd.bat" -host_arch=amd64 -arch=arm
1 The v14.34 build tools will be used as the default build tools until later VS installer invocations modify or remove Microsoft.VCToolsVersion.v143.default.txt.
2 Use of the VCVARS_USER_VERSION environment variable appears to be undocumented.
3.3. Target ARM64 With v14.34 Build Tools
3.3.1. Installation Steps
New Installation - Workload Method:
VCToolsVersion.
default.txt
VCToolsVersion.
v143.default.txt
[x] Desktop development with C++
Individual Components:
[x] MSVC v143 - VS 2022 C++ ARM64/ARM64EC
build tools (latest)
[x] MSVC v143 - VS 2022 C++ ARM64/ARM64EC
build tools (v14.34-17.4)
New Installation - Minimal Component Method:
VCToolsVersion.
default.txt
VCToolsVersion.
v143.default.txt
[x] MSVC v143 - VS 2022 C++ ARM64/ARM64EC
build tools (latest)
[x] MSVC v143 - VS 2022 C++ x64/x86
build tools (latest)
[x] Windows 11 SDK (10.0.22621.0)
[x] MSVC v143 - VS 2022 C++ ARM64/ARM64EC
build tools (v14.34-17.4)
Existing Installation - ARM64 Build Tools (v14.34 Only):
VCToolsVersion.
default.txt
VCToolsVersion.
v143.default.txt
[x] MSVC v143 - VS 2022 ARM64/ARM64EC
build tools (v14.34-17.4)
[x] Windows 11 SDK (10.0.22621.0)
[x] MSVC v143 - VS 2022 C++ ARM64/ARM64EC
build tools (latest)
[ ] MSVC v143 - VS 2022 C++ ARM64/ARM64EC
build tools (v14.34-17.4)
[x] MSVC v143 - VS 2022 C++ x64/x86
build tools (latest)
[x] MSVC v143 - VS 2022 C++ ARM64/ARM64EC
build tools (v14.34-17.4)
3.3.2. Sample Invocations
SCons environments targeting arm64:
1 The v14.34 build tools will be used as the default build tools until later VS installer invocations modify or remove Microsoft.VCToolsVersion.v143.default.txt.
Windows command-line invocations targeting arm64 using amd64 build tools:
-vcvars_ver=14.34
"%VS2022INSTALLDIR%\VC\Auxiliary\Build\vcvarsamd64_arm64.bat"
"%VS2022INSTALLDIR%\VC\Auxiliary\Build\vcvarsall.bat" x64_arm64
"%VS2022INSTALLDIR%\Common7\Tools\VsDevCmd.bat" -host_arch=amd64 -arch=arm64
-vcvars_ver=14.3
"%VS2022INSTALLDIR%\VC\Auxiliary\Build\vcvarsamd64_arm64.bat"
"%VS2022INSTALLDIR%\VC\Auxiliary\Build\vcvarsall.bat" x64_arm64
"%VS2022INSTALLDIR%\Common7\Tools\VsDevCmd.bat" -host_arch=amd64 -arch=arm64
1 The v14.34 build tools will be used as the default build tools until later VS installer invocations modify or remove Microsoft.VCToolsVersion.v143.default.txt.
2 Use of the VCVARS_USER_VERSION environment variable appears to be undocumented.
3.4. Target All With v14.34 Build Tools
3.4.1. Installation Steps
New Installation - Workload Method:
VCToolsVersion.
default.txt
VCToolsVersion.
v143.default.txt
[x] Desktop development with C++
Individual Components:
[x] MSVC v143 - VS 2022 C++ ARM
build tools (latest)
[x] MSVC v143 - VS 2022 C++ ARM64/ARM64EC
build tools (latest)
[x] MSVC v143 - VS 2022 C++ ARM
build tools (v14.34-17.4)
[x] MSVC v143 - VS 2022 C++ ARM64/ARM64EC
build tools (v14.34-17.4)
[x] MSVC v143 - VS 2022 C++ x64/x86
build tools (v14.34-17.4)
New Installation - Minimal Component Method:
VCToolsVersion.
default.txt
VCToolsVersion.
v143.default.txt
[x] MSVC v143 - VS 2022 C++ ARM
build tools (latest)
[x] MSVC v143 - VS 2022 C++ ARM64/ARM64EC
build tools (latest)
[x] MSVC v143 - VS 2022 C++ x64/x86
build tools (latest)
[x] Windows 11 SDK (10.0.22621.0)
[x] MSVC v143 - VS 2022 C++ ARM
build tools (v14.34-17.4)
[x] MSVC v143 - VS 2022 C++ ARM64/ARM64EC
build tools (v14.34-17.4)
[x] MSVC v143 - VS 2022 C++ x64/x86
build tools (v14.34-17.4)
Existing Installation - Target All Build Tools (v14.34 Only):
VCToolsVersion.
default.txt
VCToolsVersion.
v143.default.txt
[x] MSVC v143 - VS 2022 ARM
build tools (v14.34-17.4)
[x] MSVC v143 - VS 2022 ARM64/ARM64EC
build tools (v14.34-17.4)
[x] MSVC v143 - VS 2022 x64/x86
build tools (v14.34-17.4)
[x] Windows 11 SDK (10.0.22621.0)
[x] MSVC v143 - VS 2022 C++ ARM
build tools (latest)
[ ] MSVC v143 - VS 2022 C++ ARM
build tools (v14.34-17.4)
[x] MSVC v143 - VS 2022 C++ ARM64/ARM64EC
build tools (latest)
[ ] MSVC v143 - VS 2022 C++ ARM64/ARM64EC
build tools (v14.34-17.4)
[x] MSVC v143 - VS 2022 C++ x64/x86
build tools (latest)
[ ] MSVC v143 - VS 2022 C++ x64/x86
build tools (v14.34-17.4)
[x] MSVC v143 - VS 2022 C++ ARM
build tools (v14.34-17.4)
[x] MSVC v143 - VS 2022 C++ ARM64/ARM64EC
build tools (v14.34-17.4)
[x] MSVC v143 - VS 2022 C++ x64/x86
build tools (v14.34-17.4)
3.4.2. Sample Invocations
SCons environments for all targets:
1 The v14.34 build tools will be used as the default build tools until later VS installer invocations modify or remove Microsoft.VCToolsVersion.v143.default.txt.
Windows command-line invocations for all targets:
4. VS 2022 With v14.34 Build Tools and the SCons MSVC Cache
4.1. SCons MSVC Cache Force Default Arguments
From the Undocumented Features section of README - SCons.Tool.MSCommon:
4.2. v14.34 Build Tools Followed by Latest Build Tools
MSVC version file values :
VCToolsVersion.
default.txt
VCToolsVersion.
v143.default.txt
SCons results without the MSVC cache enabled:
SCons results with the MSVC cache enabled:
1If a newer Windows SDK version is installed after Step A, the cached environment paths for the Default column would be invalid as they would include the earlier Windows SDK version paths. If the earlier Windows SDK version is still installed, the cached environment would be silently incorrect.
4.3. Latest Build Tools Followed by v14.34 Build Tools
MSVC version file values :
VCToolsVersion.
default.txt
VCToolsVersion.
v143.default.txt
SCons results without the MSVC cache enabled:
SCons results with the MSVC cache enabled:
1If a newer Windows SDK version is installed after Step A, the cached environment paths for the Default column would be invalid as they would include the earlier Windows SDK version paths. If the earlier Windows SDK version is still installed, the cached environment would be silently incorrect.
Beta Was this translation helpful? Give feedback.
All reactions