diff --git a/lib/configure.js b/lib/configure.js index f4820b514b..1d0b654e01 100644 --- a/lib/configure.js +++ b/lib/configure.js @@ -291,9 +291,16 @@ function configure (gyp, argv, callback) { // Windows expects an absolute path output_dir = buildDir } + + var target_arch_gyp_variable = '<(target_arch)'; + if (process.platform === 'win32' && python.toLowerCase().endsWith('.bat')) { + // Windows will interpret python as a batch file, so we need to escape the '<' character + target_arch_gyp_variable = '^^^<(target_arch)' + } + var nodeGypDir = path.resolve(__dirname, '..') var nodeLibFile = path.join(nodeDir, - !gyp.opts.nodedir ? '<(target_arch)' : '$(Configuration)', + !gyp.opts.nodedir ? target_arch_gyp_variable : '$(Configuration)', release.name + '.lib') argv.push('-I', addon_gypi)