Skip to content

Commit 01147b4

Browse files
nornagonrvagg
authored andcommitted
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 ``` PR-URL: #21530 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: João Reis <[email protected]>
1 parent df087cf commit 01147b4

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

configure

+8-2
Original file line numberDiff line numberDiff line change
@@ -1074,8 +1074,14 @@ def configure_library(lib, output):
10741074

10751075
# libpath needs to be provided ahead libraries
10761076
if options.__dict__[shared_lib + '_libpath']:
1077-
output['libraries'] += [
1078-
'-L%s' % options.__dict__[shared_lib + '_libpath']]
1077+
if flavor == 'win':
1078+
if 'msvs_settings' not in output:
1079+
output['msvs_settings'] = { 'VCLinkerTool': { 'AdditionalOptions': [] } }
1080+
output['msvs_settings']['VCLinkerTool']['AdditionalOptions'] += [
1081+
'/LIBPATH:%s' % options.__dict__[shared_lib + '_libpath']]
1082+
else:
1083+
output['libraries'] += [
1084+
'-L%s' % options.__dict__[shared_lib + '_libpath']]
10791085
elif pkg_libpath:
10801086
output['libraries'] += [pkg_libpath]
10811087

0 commit comments

Comments
 (0)