Skip to content

Commit e8263cb

Browse files
committed
build: make --shared-[...]-path work on Windows
The `-L<path>` 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 ```
1 parent 95205a6 commit e8263cb

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

configure

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,8 +1020,14 @@ def configure_library(lib, output):
10201020

10211021
# libpath needs to be provided ahead libraries
10221022
if options.__dict__[shared_lib + '_libpath']:
1023-
output['libraries'] += [
1024-
'-L%s' % options.__dict__[shared_lib + '_libpath']]
1023+
if flavor == 'win':
1024+
if 'msvs_settings' not in output:
1025+
output['msvs_settings'] = { 'VCLinkerTool': { 'AdditionalOptions': [] } }
1026+
output['msvs_settings']['VCLinkerTool']['AdditionalOptions'] += [
1027+
'/LIBPATH:%s' % options.__dict__[shared_lib + '_libpath']]
1028+
else:
1029+
output['libraries'] += [
1030+
'-L%s' % options.__dict__[shared_lib + '_libpath']]
10251031
elif pkg_libpath:
10261032
output['libraries'] += [pkg_libpath]
10271033

0 commit comments

Comments
 (0)