Skip to content

Commit 53d8cb9

Browse files
NatalieWolfebnoordhuis
authored andcommittedJun 8, 2018
Prefix build targets with /t: on Windows
Currently, on non-Windows platforms, it is possible to have a multi-target native module and specify building just some of the targets using `node-gyp build my_target`. On Windows, however, specifying the targets to build requires the `/t:` or `/target:` flag. Without this change you will get an `MSB1008` error because MSBuild thinks you are trying to specify multiple solutions. PR-URL: #1164 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
1 parent 53a5f8f commit 53d8cb9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎lib/build.js

+4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ function build (gyp, argv, callback) {
2323
platformMake = 'gmake'
2424
} else if (process.platform.indexOf('bsd') !== -1) {
2525
platformMake = 'gmake'
26+
} else if (win && argv.length > 0) {
27+
argv = argv.map(function(target) {
28+
return '/t:' + target
29+
})
2630
}
2731

2832
var release = processRelease(argv, gyp, process.version, process.release)

0 commit comments

Comments
 (0)
Please sign in to comment.