diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index 85f689646..cb730de5b 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: