diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2023-03-27 10:39:18 -0400 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2023-03-27 15:19:17 -0400 |
commit | 65c22d8c38eba320f34576f917b106cc03e89123 (patch) | |
tree | cb6c1ace93e402016407fce424721a17ea315ac9 /mesonbuild/build.py | |
parent | 0c91c474d379e21a6c4f117aecd7178f6ff353dd (diff) | |
download | meson-65c22d8c38eba320f34576f917b106cc03e89123.zip meson-65c22d8c38eba320f34576f917b106cc03e89123.tar.gz meson-65c22d8c38eba320f34576f917b106cc03e89123.tar.bz2 |
custom_target: libfoo.so.1 is linkable
Diffstat (limited to 'mesonbuild/build.py')
-rw-r--r-- | mesonbuild/build.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py index 82992cd..6d6403b 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -2595,11 +2595,18 @@ class CustomTarget(Target, CommandBase): raise InvalidArguments('Substitution in depfile for custom_target that does not have an input file.') return self.depfile + def is_linkable_output(self, output: str) -> bool: + if output.endswith(('.a', '.dll', '.lib', '.so', '.dylib')): + return True + # libfoo.so.X soname + if re.search(r'\.so(\.\d+)*$', output): + return True + return False + def is_linkable_target(self) -> bool: if len(self.outputs) != 1: return False - suf = os.path.splitext(self.outputs[0])[-1] - return suf in {'.a', '.dll', '.lib', '.so', '.dylib'} + return self.is_linkable_output(self.outputs[0]) def links_dynamically(self) -> bool: """Whether this target links dynamically or statically @@ -2868,8 +2875,7 @@ class CustomTargetIndex(HoldableObject): return self.target.get_link_dep_subdirs() def is_linkable_target(self) -> bool: - suf = os.path.splitext(self.output)[-1] - return suf in {'.a', '.dll', '.lib', '.so', '.dylib'} + return self.target.is_linkable_output(self.output) def links_dynamically(self) -> bool: """Whether this target links dynamically or statically |