Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Commit ea403e1

Browse files
nornagoncodebytere
authored andcommitted
chore: make --shared-[...]-path work on Windows (#41)
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 ``` See nodejs/node#21530
1 parent 2f2bf71 commit ea403e1

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

configure

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

10861086
# libpath needs to be provided ahead libraries
10871087
if options.__dict__[shared_lib + '_libpath']:
1088-
output['libraries'] += [
1089-
'-L%s' % options.__dict__[shared_lib + '_libpath']]
1088+
if flavor == 'win':
1089+
if 'msvs_settings' not in output:
1090+
output['msvs_settings'] = { 'VCLinkerTool': { 'AdditionalOptions': [] } }
1091+
output['msvs_settings']['VCLinkerTool']['AdditionalOptions'] += [
1092+
'/LIBPATH:%s' % options.__dict__[shared_lib + '_libpath']]
1093+
else:
1094+
output['libraries'] += [
1095+
'-L%s' % options.__dict__[shared_lib + '_libpath']]
10901096
elif pkg_libpath:
10911097
output['libraries'] += [pkg_libpath]
10921098

0 commit comments

Comments
 (0)