diff options
-rw-r--r-- | mesonbuild/backend/backends.py | 4 | ||||
-rwxr-xr-x | run_unittests.py | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index 562e467..c737d49 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -306,7 +306,7 @@ class Backend: if len(la) == 1 and la[0].startswith(self.environment.get_source_dir()): # The only link argument is an absolute path to a library file. libpath = la[0] - if not(libpath.lower().endswith('.dll') or libpath.lower().endswith('.so')): + if os.path.splitext(libpath)[1] not in ['.dll', '.lib', '.so']: continue absdir = os.path.split(libpath)[0] rel_to_src = absdir[len(self.environment.get_source_dir())+1:] @@ -530,6 +530,8 @@ class Backend: dirseg = os.path.join(self.environment.get_build_dir(), self.get_target_dir(ld)) if dirseg not in result: result.append(dirseg) + for deppath in self.rpaths_for_bundled_shared_libraries(target): + result.append(os.path.normpath(os.path.join(self.environment.get_build_dir(), deppath))) return result def write_benchmark_file(self, datafile): diff --git a/run_unittests.py b/run_unittests.py index abff78a..b1021e0 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -1368,7 +1368,7 @@ int main(int argc, char **argv) { if compiler == 'cl': extra_args = [] shlibfile = os.path.join(tdir, 'alexandria.' + shared_suffix) - link_cmd = ['link', '/NOLOGO','/DLL', '/DEBUG', '/IMPLIB:alexandria.lib' '/OUT:' + shlibfile, objectfile] + link_cmd = ['link', '/NOLOGO','/DLL', '/DEBUG', '/IMPLIB:' + os.path.join(tdir, 'alexandria.lib'), '/OUT:' + shlibfile, objectfile] else: extra_args = ['-fPIC'] shlibfile = os.path.join(tdir, 'libalexandria.' + shared_suffix) @@ -1384,6 +1384,12 @@ int main(int argc, char **argv) { self.run_tests() finally: os.unlink(shlibfile) + if mesonbuild.mesonlib.is_windows(): + # Clean up all the garbage MSVC writes in the + # source tree. + for fname in glob(os.path.join(tdir, 'alexandria.*')): + if os.path.splitext(fname)[1] not in ['.c', '.h']: + os.unlink(fname) class FailureTests(BasePlatformTests): ''' |