From 4a04f70e3ff6e803c4177a1b80a64d461e097a8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Reis?= Date: Mon, 11 Nov 2019 11:56:01 +0000 Subject: [PATCH] overwrite 'msbuild_toolset' only if 'toolset' is defined (#1242) node-gyp uses 'msbuild_toolset' in 'target_defaults' to specify what toolset should be used, according to what version of Visual Studio was detected. Before this change, when 'toolset' was not specified, node-sqlite3 failed to compile with any version of Visual Studio after 2015, because gyp fails to detect the toolset correctly. With this change 'toolset' is only used if defined, fixing compilation with node-gyp and recent VS versions. --- deps/common-sqlite.gypi | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/deps/common-sqlite.gypi b/deps/common-sqlite.gypi index 1a5c6cc10..abd9e83c3 100644 --- a/deps/common-sqlite.gypi +++ b/deps/common-sqlite.gypi @@ -5,7 +5,11 @@ }, 'target_defaults': { 'default_configuration': 'Release', - 'msbuild_toolset':'<(toolset)', + 'conditions': [ + [ 'toolset!=""', { + 'msbuild_toolset':'<(toolset)' + }] + ], 'configurations': { 'Debug': { 'defines!': [