Skip to content

Commit d4f09e6

Browse files
committed
fall back to x64 if arm64 doesn't exist
1 parent 23c72f1 commit d4f09e6

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

lib/find-visualstudio.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -430,12 +430,20 @@ class VisualStudioFinder {
430430

431431
// Helper - process toolset information
432432
getToolset (info, versionYear) {
433-
const vcTools = process.arch === 'arm64' ? 'VC.Tools.ARM64' : 'VC.Tools.x86.x64'
434-
const pkg = `Microsoft.VisualStudio.Component.${vcTools}`
433+
const vcToolsArm64 = 'VC.Tools.ARM64';
434+
const pkgArm64 = `Microsoft.VisualStudio.Component.${vcToolsArm64}`
435+
const vcToolsX64 = 'VC.Tools.x86.x64';
436+
const pkgX64 = `Microsoft.VisualStudio.Component.${vcToolsX64}`
435437
const express = 'Microsoft.VisualStudio.WDExpress'
436438

437-
if (info.packages.indexOf(pkg) !== -1) {
438-
this.log.silly(`- found ${vcTools}`)
439+
if (process.arch === 'arm64' && info.packages.indexOf(pkgArm64)) {
440+
this.log.silly(`- found ${vcToolsArm64}`)
441+
} else if (info.packages.indexOf(pkg) !== -1) {
442+
if (process.arch === 'arm64') {
443+
this.log.addLog(`- found ${vcToolsX64} on ARM64 platform. Expect less performance and/or link failure with ARM64 binary.`)
444+
} else {
445+
this.log.silly(`- found ${vcToolsX64}`)
446+
}
439447
} else if (info.packages.indexOf(express) !== -1) {
440448
this.log.silly('- found Visual Studio Express (looking for toolset)')
441449
} else {

0 commit comments

Comments
 (0)