aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/build.py
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2022-01-12 11:47:57 -0500
committerXavier Claessens <xclaesse@gmail.com>2022-03-07 09:27:02 -0500
commit01e92dc543fb7443fba8a33687ffd726f11433e8 (patch)
tree6d5bc574ff198d35aae363baab191f759cbceac6 /mesonbuild/build.py
parent219f40c1e4689060f3c299edd463fc5f5a625608 (diff)
downloadmeson-01e92dc543fb7443fba8a33687ffd726f11433e8.zip
meson-01e92dc543fb7443fba8a33687ffd726f11433e8.tar.gz
meson-01e92dc543fb7443fba8a33687ffd726f11433e8.tar.bz2
Fix default install tag for shared lib symlinks
Versioned shared libraries should have .so file in devel, .so.1 and .so.1.2.3 in runtime. Fixes: #9811
Diffstat (limited to 'mesonbuild/build.py')
-rw-r--r--mesonbuild/build.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index bb57ec8..e0f07ab 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -1471,8 +1471,8 @@ You probably should put it in link_with instead.''')
else:
self.extra_args[language] = args
- def get_aliases(self) -> T.Dict[str, str]:
- return {}
+ def get_aliases(self) -> T.List[T.Tuple[str, str, str]]:
+ return []
def get_langs_used_by_deps(self) -> T.List[str]:
'''
@@ -2240,7 +2240,7 @@ class SharedLibrary(BuildTarget):
def get_all_link_deps(self):
return [self] + self.get_transitive_link_deps()
- def get_aliases(self) -> T.Dict[str, str]:
+ def get_aliases(self) -> T.List[T.Tuple[str, str, str]]:
"""
If the versioned library name is libfoo.so.0.100.0, aliases are:
* libfoo.so.0 (soversion) -> libfoo.so.0.100.0
@@ -2248,7 +2248,7 @@ class SharedLibrary(BuildTarget):
Same for dylib:
* libfoo.dylib (unversioned; for linking) -> libfoo.0.dylib
"""
- aliases: T.Dict[str, str] = {}
+ aliases: T.List[T.Tuple[str, str, str]] = []
# Aliases are only useful with .so and .dylib libraries. Also if
# there's no self.soversion (no versioning), we don't need aliases.
if self.suffix not in ('so', 'dylib') or not self.soversion:
@@ -2260,14 +2260,16 @@ class SharedLibrary(BuildTarget):
if self.suffix == 'so' and self.ltversion and self.ltversion != self.soversion:
alias_tpl = self.filename_tpl.replace('ltversion', 'soversion')
ltversion_filename = alias_tpl.format(self)
- aliases[ltversion_filename] = self.filename
+ tag = self.install_tag[0] or 'runtime'
+ aliases.append((ltversion_filename, self.filename, tag))
# libfoo.so.0/libfoo.0.dylib is the actual library
else:
ltversion_filename = self.filename
# Unversioned alias:
# libfoo.so -> libfoo.so.0
# libfoo.dylib -> libfoo.0.dylib
- aliases[self.basic_filename_tpl.format(self)] = ltversion_filename
+ tag = self.install_tag[0] or 'devel'
+ aliases.append((self.basic_filename_tpl.format(self), ltversion_filename, tag))
return aliases
def type_suffix(self):