|
1 |
| - |
2 | 1 | module.exports = exports = configure
|
3 | 2 |
|
4 | 3 | /**
|
@@ -175,7 +174,7 @@ function configure (gyp, argv, callback) {
|
175 | 174 |
|
176 | 175 | var config = process.config || {}
|
177 | 176 | , defaults = config.target_defaults
|
178 |
| - , variables = config.variables |
| 177 | + , variablesa = config.variables |
179 | 178 |
|
180 | 179 | // default "config.variables"
|
181 | 180 | if (!variables) variables = config.variables = {}
|
@@ -303,13 +302,18 @@ function configure (gyp, argv, callback) {
|
303 | 302 | // Windows expects an absolute path
|
304 | 303 | output_dir = buildDir
|
305 | 304 | }
|
306 |
| - |
307 |
| - argv.push('-I', addon_gypi) |
308 |
| - argv.push('-I', common_gypi) |
| 305 | + |
| 306 | + // Fix for spaces and other special characters in path. |
| 307 | + function shellEscape(str) { |
| 308 | + return str.replace(/(["\s'$`\\])/g, '\\$1'); |
| 309 | + }; |
| 310 | + |
| 311 | + argv.push('-I', shellEscape(addon_gypi)) |
| 312 | + argv.push('-I', shellEscape(common_gypi)) |
309 | 313 | argv.push('-Dlibrary=shared_library')
|
310 | 314 | argv.push('-Dvisibility=default')
|
311 |
| - argv.push('-Dnode_root_dir=' + nodeDir) |
312 |
| - argv.push('-Dmodule_root_dir=' + process.cwd()) |
| 315 | + argv.push('-Dnode_root_dir=' + shellEscape(nodeDir)) |
| 316 | + argv.push('-Dmodule_root_dir=' + shellEscape(process.cwd())) |
313 | 317 | argv.push('--depth=.')
|
314 | 318 |
|
315 | 319 | // tell gyp to write the Makefile/Solution files into output_dir
|
|
0 commit comments