mirror of
https://github.com/electron/node-gyp.git
synced 2025-08-15 12:58:19 +02:00
Fix reading msvs version on Windows (#2644)
* fix: fix reading msvs version on windows
This commit is contained in:
parent
b030555cdb
commit
53c99ae573
3 changed files with 11 additions and 2 deletions
|
@ -85,7 +85,7 @@ function configure (gyp, argv, callback) {
|
||||||
'build dir', '"build" dir needed to be created?', isNew ? 'Yes' : 'No'
|
'build dir', '"build" dir needed to be created?', isNew ? 'Yes' : 'No'
|
||||||
)
|
)
|
||||||
if (win) {
|
if (win) {
|
||||||
findVisualStudio(release.semver, gyp.opts.msvs_version,
|
findVisualStudio(release.semver, gyp.opts['msvs-version'],
|
||||||
createConfigFile)
|
createConfigFile)
|
||||||
} else {
|
} else {
|
||||||
createPythonSymlink()
|
createPythonSymlink()
|
||||||
|
|
|
@ -60,7 +60,7 @@ proto.configDefs = {
|
||||||
debug: Boolean, // 'build'
|
debug: Boolean, // 'build'
|
||||||
directory: String, // bin
|
directory: String, // bin
|
||||||
make: String, // 'build'
|
make: String, // 'build'
|
||||||
msvs_version: String, // 'configure'
|
'msvs-version': String, // 'configure'
|
||||||
ensure: Boolean, // 'install'
|
ensure: Boolean, // 'install'
|
||||||
solution: String, // 'build' (windows only)
|
solution: String, // 'build' (windows only)
|
||||||
proxy: String, // 'install'
|
proxy: String, // 'install'
|
||||||
|
|
|
@ -38,4 +38,13 @@ describe('options', function () {
|
||||||
|
|
||||||
assert.strictEqual(g.opts['force-process-config'], 'true')
|
assert.strictEqual(g.opts['force-process-config'], 'true')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('options with msvs_version', () => {
|
||||||
|
process.env.npm_config_msvs_version = '2017'
|
||||||
|
|
||||||
|
const g = gyp()
|
||||||
|
g.parseArgv(['rebuild']) // Also sets opts.argv.
|
||||||
|
|
||||||
|
assert.strictEqual(g.opts['msvs-version'], '2017')
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue