From b175a5a0520aed7e18c61fde063348b3fb31d6b6 Mon Sep 17 00:00:00 2001 From: Jeremy Apthorp Date: Wed, 27 Jun 2018 10:27:55 +0200 Subject: [PATCH] chore: make --shared-[...]-path work on Windows (#41) 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 ``` See nodejs/node#21530 --- configure | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 54ec374d627..6fdaf5e7133 100755 --- a/configure +++ b/configure @@ -1051,8 +1051,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]