From f506a5f46e990365be0d49de777b90789904fc66 Mon Sep 17 00:00:00 2001 From: Jeremy Apthorp Date: Mon, 25 Jun 2018 12:28:03 -0700 Subject: [PATCH] build: make --shared-[...]-path work on Windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `-L` syntax isn't recognized by link.exe, and gyp doesn't translate it properly. Without this, link.exe generates the following warning and fails to link: ``` LINK : warning LNK4044: unrecognized option '/LC:/Users/nornagon/...'; ignored ``` PR-URL: https://github.com/nodejs/node/pull/21530 Reviewed-By: Anna Henningsen Reviewed-By: James M Snell Reviewed-By: João Reis --- configure | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/configure b/configure index f89812cc94819d..c9d598b799204b 100755 --- a/configure +++ b/configure @@ -1074,8 +1074,14 @@ def configure_library(lib, output): # libpath needs to be provided ahead libraries if options.__dict__[shared_lib + '_libpath']: - output['libraries'] += [ - '-L%s' % options.__dict__[shared_lib + '_libpath']] + if flavor == 'win': + if 'msvs_settings' not in output: + output['msvs_settings'] = { 'VCLinkerTool': { 'AdditionalOptions': [] } } + output['msvs_settings']['VCLinkerTool']['AdditionalOptions'] += [ + '/LIBPATH:%s' % options.__dict__[shared_lib + '_libpath']] + else: + output['libraries'] += [ + '-L%s' % options.__dict__[shared_lib + '_libpath']] elif pkg_libpath: output['libraries'] += [pkg_libpath]