Skip to content

Commit 75673e0

Browse files
committed
configure: supply target_arch define to gyp.js
Since version 1.1.1 gyp.js uses environment files. Set --target_arch command-line option with value of node-gyp --arch option in order to generate proper ninja environment file.
1 parent c9303d7 commit 75673e0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/configure.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ function configure (gyp, argv, callback) {
3131
, buildDir = path.resolve('build')
3232
, configNames = [ 'config.gypi', 'common.gypi' ]
3333
, configs = []
34+
, arch
3435
, nodeDir
3536
, release = processRelease(argv, gyp, process.version, process.release)
3637

@@ -130,7 +131,7 @@ function configure (gyp, argv, callback) {
130131
}
131132

132133
// set the target_arch variable
133-
variables.target_arch = gyp.opts.arch || process.arch || 'ia32'
134+
variables.target_arch = arch = gyp.opts.arch || process.arch || 'ia32'
134135

135136
// set the node development directory
136137
variables.nodedir = nodeDir
@@ -297,6 +298,7 @@ function configure (gyp, argv, callback) {
297298
var cp = gyp.spawn(python, argv)
298299
cp.on('exit', onCpExit)
299300
} else {
301+
argv.push('-Dtarget_arch=' + arch)
300302
onCpExit(gypjs.main(argv))
301303
}
302304
})

0 commit comments

Comments
 (0)