diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2018-08-28 11:47:14 +0530 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-08-28 19:10:30 +0300 |
commit | 8dd2e42de3cc1be535fcef4bc43f413dff33f20d (patch) | |
tree | 7e3960de8a8389debe1eae308922aa8ef7f8d042 /mesonbuild | |
parent | 234bb45b025700182d942b8f8421bc78f4cd7d4e (diff) | |
download | meson-8dd2e42de3cc1be535fcef4bc43f413dff33f20d.zip meson-8dd2e42de3cc1be535fcef4bc43f413dff33f20d.tar.gz meson-8dd2e42de3cc1be535fcef4bc43f413dff33f20d.tar.bz2 |
CompilerArgs: -Wl,-lfoo is also a valid way to pass a library
Treat it the same as -lfoo by deduping and adding to --start/end-group
Reported at https://gitlab.gnome.org/GNOME/glib/issues/1496
We don't do any advanced transformation for MSVC or de-dup because
this is a very rare syntax.
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/compilers/compilers.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index 352c49e..70c7c3c 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -521,7 +521,7 @@ class CompilerArgs(list): dedup2_suffixes = () dedup2_args = () # Arg prefixes and args that must be de-duped by returning 1 - dedup1_prefixes = ('-l',) + dedup1_prefixes = ('-l', '-Wl,-l') dedup1_suffixes = ('.lib', '.dll', '.so', '.dylib', '.a') # Match a .so of the form path/to/libfoo.so.0.1.0 # Only UNIX shared libraries require this. Others have a fixed extension. @@ -625,7 +625,7 @@ class CompilerArgs(list): group_start = -1 group_end = -1 for i, each in enumerate(new): - if not each.startswith('-l') and not each.endswith('.a') and \ + if not each.startswith(('-Wl,-l', '-l')) and not each.endswith('.a') and \ not soregex.match(each): continue group_end = i |