summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/node-gyp/lib/configure.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/node-gyp/lib/configure.js')
-rw-r--r--deps/npm/node_modules/node-gyp/lib/configure.js29
1 files changed, 18 insertions, 11 deletions
diff --git a/deps/npm/node_modules/node-gyp/lib/configure.js b/deps/npm/node_modules/node-gyp/lib/configure.js
index 267e7587f5..564564eea4 100644
--- a/deps/npm/node_modules/node-gyp/lib/configure.js
+++ b/deps/npm/node_modules/node-gyp/lib/configure.js
@@ -17,7 +17,7 @@ if (win) {
function configure (gyp, argv, callback) {
var python
var buildDir = path.resolve('build')
- var configNames = [ 'config.gypi', 'common.gypi' ]
+ var configNames = ['config.gypi', 'common.gypi']
var configs = []
var nodeDir
var release = processRelease(argv, gyp, process.version, process.release)
@@ -60,7 +60,7 @@ function configure (gyp, argv, callback) {
// into devdir. Otherwise only install if they're not already there.
gyp.opts.ensure = !gyp.opts.tarball
- gyp.commands.install([ release.version ], function (err) {
+ gyp.commands.install([release.version], function (err) {
if (err) {
return callback(err)
}
@@ -132,7 +132,7 @@ function configure (gyp, argv, callback) {
// set the target_arch variable
variables.target_arch = gyp.opts.arch || process.arch || 'ia32'
if (variables.target_arch === 'arm64') {
- defaults['msvs_configuration_platform'] = 'ARM64'
+ defaults.msvs_configuration_platform = 'ARM64'
}
// set the node development directory
@@ -142,22 +142,22 @@ function configure (gyp, argv, callback) {
variables.standalone_static_library = gyp.opts.thin ? 0 : 1
if (win) {
- process.env['GYP_MSVS_VERSION'] = Math.min(vsInfo.versionYear, 2015)
- process.env['GYP_MSVS_OVERRIDE_PATH'] = vsInfo.path
- defaults['msbuild_toolset'] = vsInfo.toolset
+ process.env.GYP_MSVS_VERSION = Math.min(vsInfo.versionYear, 2015)
+ process.env.GYP_MSVS_OVERRIDE_PATH = vsInfo.path
+ defaults.msbuild_toolset = vsInfo.toolset
if (vsInfo.sdk) {
- defaults['msvs_windows_target_platform_version'] = vsInfo.sdk
+ defaults.msvs_windows_target_platform_version = vsInfo.sdk
}
if (variables.target_arch === 'arm64') {
if (vsInfo.versionMajor > 15 ||
(vsInfo.versionMajor === 15 && vsInfo.versionMajor >= 9)) {
- defaults['msvs_enable_marmasm'] = 1
+ defaults.msvs_enable_marmasm = 1
} else {
log.warn('Compiling ARM64 assembly is only available in\n' +
'Visual Studio 2017 version 15.9 and above')
}
}
- variables['msbuild_path'] = vsInfo.msBuild
+ variables.msbuild_path = vsInfo.msBuild
}
// loop through the rest of the opts and add the unknown ones as variables.
@@ -190,7 +190,7 @@ function configure (gyp, argv, callback) {
var json = JSON.stringify(config, boolsToString, 2)
log.verbose('build/' + configFilename, 'writing out config file: %s', configPath)
configs.push(configPath)
- fs.writeFile(configPath, [ prefix, json, '' ].join('\n'), findConfigs)
+ fs.writeFile(configPath, [prefix, json, ''].join('\n'), findConfigs)
}
function findConfigs (err) {
@@ -295,6 +295,7 @@ function configure (gyp, argv, callback) {
outputDir = buildDir
}
var nodeGypDir = path.resolve(__dirname, '..')
+
var nodeLibFile = path.join(nodeDir,
!gyp.opts.nodedir ? '<(target_arch)' : '$(Configuration)',
release.name + '.lib')
@@ -308,6 +309,12 @@ function configure (gyp, argv, callback) {
argv.push('-Dnode_exp_file=' + nodeExpFile)
}
argv.push('-Dnode_gyp_dir=' + nodeGypDir)
+
+ // Do this to keep Cygwin environments happy, else the unescaped '\' gets eaten up,
+ // resulting in bad paths, Ex c:parentFolderfolderanotherFolder instead of c:\parentFolder\folder\anotherFolder
+ if (win) {
+ nodeLibFile = nodeLibFile.replace(/\\/g, '\\\\')
+ }
argv.push('-Dnode_lib_file=' + nodeLibFile)
argv.push('-Dmodule_root_dir=' + process.cwd())
argv.push('-Dnode_engine=' +
@@ -328,7 +335,7 @@ function configure (gyp, argv, callback) {
argv.unshift(gypScript)
// make sure python uses files that came with this particular node package
- var pypath = [ path.join(__dirname, '..', 'gyp', 'pylib') ]
+ var pypath = [path.join(__dirname, '..', 'gyp', 'pylib')]
if (process.env.PYTHONPATH) {
pypath.push(process.env.PYTHONPATH)
}