Skip to content

Commit 01e4f7b

Browse files
committed
SwiftInstaller: update the known toolset list
Move the previous VS2019 names which are the current latest to the top of the list. Update the VS2019 toolset names to match that from VS2022 as the current name will take care of VS2019 case. Additionally, add the VS2022 toolset names to the list. This allows this custom action to support VS2017, VS2019, and VS2022.
1 parent 43acf97 commit 01e4f7b

File tree

1 file changed

+29
-7
lines changed

1 file changed

+29
-7
lines changed

platforms/Windows/CustomActions/SwiftInstaller/Sources/swift_installer.cc

+29-7
Original file line numberDiff line numberDiff line change
@@ -127,17 +127,31 @@ std::vector<std::wstring> available_versions() noexcept {
127127
}
128128

129129
namespace msvc {
130-
// TODO(compnerd) add support for VS2022
130+
// Current Build Tools
131+
static const wchar_t toolset_current_x86_x64[] =
132+
L"Microsoft.VisualStudio.Component.VC.Tools.x86.x64";
133+
static const wchar_t toolset_current_arm[] =
134+
L"Microsoft.VisualStudio.Component.VC.Tools.ARM";
135+
static const wchar_t toolset_current_arm64[] =
136+
L"Microsoft.VisualStudio.Component.VC.Tools.ARM64";
137+
static const wchar_t toolset_current_arm64ec[] =
138+
L"Microsoft.VisualStudio.Component.VC.Tools.ARM64EC";
139+
140+
// VS2022 v143 Build Tools
141+
static const wchar_t toolset_v143_x86_x64[] =
142+
L"Microsoft.VisualStudio.Component.VC.14.30.17.0.x86.x64";
143+
static const wchar_t toolset_v143_arm[] =
144+
L"Microsoft.VisualStudio.Component.VC.14.30.17.0.ARM";
145+
static const wchar_t toolset_v143_arm64[] =
146+
L"Microsoft.VisualStudio.Component.VC.14.30.17.0.ARM64";
131147

132148
// VS2019 v142 Build Tools
133149
static const wchar_t toolset_v142_x86_x64[] =
134-
L"Microsoft.VisualStudio.Component.VC.Tools.x86.x64";
150+
L"Microsoft.VisualStudio.Component.VC.14.29.16.11.x86.x64";
135151
static const wchar_t toolset_v142_arm[] =
136-
L"Microsoft.VisualStudio.Component.VC.Tools.ARM";
152+
L"Microsoft.VisualStudio.Component.VC.14.29.16.11.ARM";
137153
static const wchar_t toolset_v142_arm64[] =
138-
L"Microsoft.VisualStudio.Component.VC.Tools.ARM64";
139-
static const wchar_t toolset_v142_arm64ec[] =
140-
L"Microsoft.VisualStudio.Component.VC.Tools.ARM64EC";
154+
L"Microsoft.VisualStudio.Component.VC.14.29.16.11.ARM64";
141155

142156
// VS2017 v141 Build Tools
143157
static const wchar_t toolset_v141_x86_x64[] =
@@ -148,8 +162,16 @@ static const wchar_t toolset_v141_arm64[] =
148162
L"Microsoft.VisualStudio.Component.VC.v141.ARM64";
149163

150164
static const wchar_t *known_toolsets[] = {
165+
toolset_current_x86_x64,
166+
toolset_current_arm64ec,
167+
toolset_current_arm64,
168+
toolset_current_arm,
169+
170+
toolset_v143_x86_x64,
171+
toolset_v143_arm64,
172+
toolset_v143_arm,
173+
151174
toolset_v142_x86_x64,
152-
toolset_v142_arm64ec,
153175
toolset_v142_arm64,
154176
toolset_v142_arm,
155177

0 commit comments

Comments
 (0)