Fix toolkit selection for VS 2017/2019 #1952
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Checklist
npm install && npm test
passesDescription of change
npm install --build-from-source sqlite3
failed for me in a fresh Visual Studio 2019 Build Tools environment, because node-gyp fell back to platform tools v140 which are not installed in VS 2019 by default, but v142 is. The error message was something likeThis patch basically repeats some lines that @refack has already in GYP3 to default to toolset
v141
for VS2017 andv142
for VS2019, seeIn case you're already about to replace GYP with GYP3, sorry for the noise, just ignore this PR.
Disclaimer:
Registry based detection in
MSVSVersion._DetectVisualStudioVersions
is still incomplete. Maybe it's even in GYP3, because registry handling has changed in VS2017/19 and keys are stored in a private location now. I didn't bother much, it works in node-gyp context anyway because node-gyps configure.js does it's own detection based onVCINSTALLDIR
and setsGYP_MSVS_OVERRIDE_PATH
andGYP_MSVS_VERSION
accordingly. Btw., why is detection done in both the JS part and GYP, shouldn't it go to GYP solely for separation of concerns?I guessed
project_version='16.0'
for 2019, but it seems theVersion
element is not meaningful anymore at all in MSBuild project files?