diff options
author | Aleksey Gurtovoy <agurtovoy@acm.org> | 2019-10-25 14:42:36 -0500 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2019-10-29 22:40:13 +0200 |
commit | 6eee9e48bbf43e2be511fbdf1b2bcfee32f614ef (patch) | |
tree | b10030f8a48565be002a5bcb2c32cd665ce8a1a7 /mesonbuild | |
parent | 6e18e5b0b3dfbb359a4ef0410dce097913e00efa (diff) | |
download | meson-6eee9e48bbf43e2be511fbdf1b2bcfee32f614ef.zip meson-6eee9e48bbf43e2be511fbdf1b2bcfee32f614ef.tar.gz meson-6eee9e48bbf43e2be511fbdf1b2bcfee32f614ef.tar.bz2 |
MSVC: support -LIBPATH
Fixes #6101 (with a test), following up #5881
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/compilers/mixins/visualstudio.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mesonbuild/compilers/mixins/visualstudio.py b/mesonbuild/compilers/mixins/visualstudio.py index 9fddbb4..ebf51ff 100644 --- a/mesonbuild/compilers/mixins/visualstudio.py +++ b/mesonbuild/compilers/mixins/visualstudio.py @@ -217,7 +217,9 @@ class VisualStudioLikeCompiler(metaclass=abc.ABCMeta): # -pthread is only valid for GCC if i in ('-mms-bitfields', '-pthread'): continue - if i.startswith('-L'): + if i.startswith('-LIBPATH:'): + i = '/LIBPATH:' + i[9:] + elif i.startswith('-L'): i = '/LIBPATH:' + i[2:] # Translate GNU-style -lfoo library name to the import library elif i.startswith('-l'): @@ -250,7 +252,7 @@ class VisualStudioLikeCompiler(metaclass=abc.ABCMeta): def native_args_to_unix(cls, args: typing.List[str]) -> typing.List[str]: result = [] for arg in args: - if arg.startswith('/LIBPATH:'): + if arg.startswith(('/LIBPATH:', '-LIBPATH:')): result.append('-L' + arg[9:]) elif arg.endswith(('.a', '.lib')) and not os.path.isabs(arg): result.append('-l' + arg) |