Skip to content

Commit

Permalink
build: make --shared-[...]-path work on Windows
Browse files Browse the repository at this point in the history
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 <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: João Reis <reis@janeasystems.com>
  • Loading branch information
nornagon authored and rvagg committed Aug 15, 2018
1 parent b171fa2 commit f506a5f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions configure
Expand Up @@ -1074,8 +1074,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]

Expand Down

0 comments on commit f506a5f

Please sign in to comment.