Skip to content

Commit

Permalink
Prefix build targets with /t: on Windows
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
NatalieWolfe authored and bnoordhuis committed Jun 8, 2018
1 parent 53a5f8f commit 53d8cb9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ function build (gyp, argv, callback) {
platformMake = 'gmake'
} else if (process.platform.indexOf('bsd') !== -1) {
platformMake = 'gmake'
} else if (win && argv.length > 0) {
argv = argv.map(function(target) {
return '/t:' + target
})
}

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

0 comments on commit 53d8cb9

Please sign in to comment.