aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend
diff options
context:
space:
mode:
authorJonathon Anderson <anderson.jonathonm@gmail.com>2023-10-06 18:06:41 -0500
committerDylan Baker <dylan@pnwbakers.com>2024-01-17 08:42:09 -0800
commit76ad5fe8d387638d21258177328763f05a0e95ae (patch)
tree561311f345ac0235fd55554a28b53a74b5cd5385 /mesonbuild/backend
parent57b7fbb29d456b1a607adc8ab3ae3d5c9eeb7341 (diff)
downloadmeson-76ad5fe8d387638d21258177328763f05a0e95ae.zip
meson-76ad5fe8d387638d21258177328763f05a0e95ae.tar.gz
meson-76ad5fe8d387638d21258177328763f05a0e95ae.tar.bz2
backend: Add rpath for external versioned .so's
On Linux many .so's are augmented with version information, e.g. libxyz.so.1.2.3. CMake will happily refer to these versioned .so's in its dependencies instead of libxyz.so (typically a symlink). Unfortunately these versioned .so's aren't recognized as libraries by the Backend's logic to produce build rpaths from library paths. Fix this by recognizing any .so extension as sufficient reason to produce a build rpath, not just if .so is the last extension.
Diffstat (limited to 'mesonbuild/backend')
-rw-r--r--mesonbuild/backend/backends.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index 85f6896..cb730de 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -780,7 +780,11 @@ class Backend:
# Windows doesn't support rpaths, but we use this function to
# emulate rpaths by setting PATH
# .dll is there for mingw gcc
- if os.path.splitext(libpath)[1] not in {'.dll', '.lib', '.so', '.dylib'}:
+ # .so's may be extended with version information, e.g. libxyz.so.1.2.3
+ if not (
+ os.path.splitext(libpath)[1] in {'.dll', '.lib', '.so', '.dylib'}
+ or re.match(r'.+\.so(\.|$)', os.path.basename(libpath))
+ ):
continue
try: