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

Commit 4879332

Browse files
nornagonMarshallOfSound
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 e61694e commit 4879332

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
@@ -1039,8 +1039,14 @@ def configure_library(lib, output):
10391039

10401040
# libpath needs to be provided ahead libraries
10411041
if options.__dict__[shared_lib + '_libpath']:
1042-
output['libraries'] += [
1043-
'-L%s' % options.__dict__[shared_lib + '_libpath']]
1042+
if flavor == 'win':
1043+
if 'msvs_settings' not in output:
1044+
output['msvs_settings'] = { 'VCLinkerTool': { 'AdditionalOptions': [] } }
1045+
output['msvs_settings']['VCLinkerTool']['AdditionalOptions'] += [
1046+
'/LIBPATH:%s' % options.__dict__[shared_lib + '_libpath']]
1047+
else:
1048+
output['libraries'] += [
1049+
'-L%s' % options.__dict__[shared_lib + '_libpath']]
10441050
elif pkg_libpath:
10451051
output['libraries'] += [pkg_libpath]
10461052

0 commit comments

Comments
 (0)