aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend/vs2010backend.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2017-06-12 20:55:19 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2017-06-12 20:55:19 +0530
commitd23e6b34c77f1e6bee8ab475ab05e3f5250949e7 (patch)
tree795ccedcfe7195cf70990381ba23495574a2fda6 /mesonbuild/backend/vs2010backend.py
parentf792641b34a83d61a421f0d76a8c72a956bdb073 (diff)
downloadmeson-d23e6b34c77f1e6bee8ab475ab05e3f5250949e7.zip
meson-d23e6b34c77f1e6bee8ab475ab05e3f5250949e7.tar.gz
meson-d23e6b34c77f1e6bee8ab475ab05e3f5250949e7.tar.bz2
Preserve -L -l pairings fetched from external deps
While adding link args for external deps, sometimes different libraries come from different prefixes, and an older version of the same library might be present in other prefixes and we don't want to accidentally pick that up. For example: /usr/local/lib/libglib-2.0.so /usr/local/lib/pkgconfig/glib-2.0.pc /usr/local/lib/libz.so /usr/local/lib/pkgconfig/zlib.pc /home/mesonuser/.local/lib/libglib-2.0.so /home/mesonuser/.local/lib/pkgconfig/glib-2.0.pc PKG_CONFIG_PATH="/home/mesonuser/.local/lib/pkgconfig/:/usr/local/lib/pkgconfig/" If a target uses `dependencies : [glib_dep, zlib_dep]`, it will end up using /usr/local/lib/libglib-2.0.so instead of /home/mesonuser/.local/lib/libglib-2.0.so despite using the pkg-config file in /home/mesonuser/.local/lib/pkgconfig because we reorder the -L flag and separate it from the -l flag. With this change, external link arguments will be added to the compiler list without de-dup or reordering. Closes https://github.com/mesonbuild/meson/issues/1718
Diffstat (limited to 'mesonbuild/backend/vs2010backend.py')
-rw-r--r--mesonbuild/backend/vs2010backend.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py
index d4a7a19..57b0437 100644
--- a/mesonbuild/backend/vs2010backend.py
+++ b/mesonbuild/backend/vs2010backend.py
@@ -908,11 +908,13 @@ class Vs2010Backend(backends.Backend):
extra_link_args += target.link_args
# External deps must be last because target link libraries may depend on them.
for dep in target.get_external_deps():
- extra_link_args += dep.get_link_args()
+ # Extend without reordering or de-dup to preserve `-L -l` sets
+ # https://github.com/mesonbuild/meson/issues/1718
+ extra_link_args.extend_direct(dep.get_link_args())
for d in target.get_dependencies():
if isinstance(d, build.StaticLibrary):
for dep in d.get_external_deps():
- extra_link_args += dep.get_link_args()
+ extra_link_args.extend_direct(dep.get_link_args())
# Add link args for c_* or cpp_* build options. Currently this only
# adds c_winlibs and cpp_winlibs when building for Windows. This needs
# to be after all internal and external libraries so that unresolved