From e8263cbc29817585f05901d4b25b1660c9eb9bec 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 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 ``` --- configure | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/configure b/configure index f72e9123b90b0f..73a3f7e49de55a 100755 --- a/configure +++ b/configure @@ -1020,8 +1020,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]