From 53d8cb967ca39e0143f1253d55be6c5d82d2b857 Mon Sep 17 00:00:00 2001 From: Natalie Wolfe Date: Mon, 3 Apr 2017 20:04:18 -0700 Subject: [PATCH] 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: https://github.com/nodejs/node-gyp/pull/1164 Reviewed-By: Ben Noordhuis --- lib/build.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/build.js b/lib/build.js index 0445fb6452..2f8e14c374 100644 --- a/lib/build.js +++ b/lib/build.js @@ -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)