Skip to content

Commit

Permalink
fall back to x64 if arm64 doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
saschanaz committed Oct 5, 2024
1 parent 23c72f1 commit f0caedc
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions lib/find-visualstudio.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,12 +430,20 @@ class VisualStudioFinder {

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

if (info.packages.indexOf(pkg) !== -1) {
this.log.silly(`- found ${vcTools}`)
if (process.arch === 'arm64' && info.packages.indexOf(pkgArm64)) {
this.log.silly(`- found ${vcToolsArm64}`)
} else if (info.packages.indexOf(pkgX64) !== -1) {
if (process.arch === 'arm64') {
this.log.addLog(`- found ${vcToolsX64} on ARM64 platform. Expect less performance and/or link failure with ARM64 binary.`)
} else {
this.log.silly(`- found ${vcToolsX64}`)
}
} else if (info.packages.indexOf(express) !== -1) {
this.log.silly('- found Visual Studio Express (looking for toolset)')
} else {
Expand Down

0 comments on commit f0caedc

Please sign in to comment.