win: support VS 2017 Desktop Express

Fixes: https://github.com/nodejs/node-gyp/issues/1881
PR-URL: https://github.com/nodejs/node-gyp/pull/1902
Reviewed-By: Rod Vagg <rod@vagg.org>
This commit is contained in:
João Reis 2019-10-02 01:50:59 +01:00 committed by Rod Vagg
parent ab2a4cc209
commit 968c9067d7
No known key found for this signature in database
GPG key ID: C273792F7D83545D
3 changed files with 47 additions and 9 deletions

View file

@ -279,15 +279,22 @@ VisualStudioFinder.prototype = {
// Helper - process toolset information
getToolset: function getToolset (info, versionYear) {
const pkg = 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64'
const express = 'Microsoft.VisualStudio.WDExpress'
if (info.packages.indexOf(pkg) !== -1) {
this.log.silly('- found VC.Tools.x86.x64')
if (versionYear === 2017) {
return 'v141'
}
if (versionYear === 2019) {
return 'v142'
}
} else if (info.packages.indexOf(express) !== -1) {
this.log.silly('- found Visual Studio Express (looking for toolset)')
} else {
return null
}
if (versionYear === 2017) {
return 'v141'
} else if (versionYear === 2019) {
return 'v142'
}
this.log.silly('- invalid versionYear:', versionYear)
return null
},