diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2017-10-02 00:56:38 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-10-02 01:30:30 +0300 |
commit | ec45c29c9ddd5d848eb1555cdc09246d8900afec (patch) | |
tree | e1aff1df0de7ff5ee8268748fc3bd42a68743a7b /mesonbuild/backend/backends.py | |
parent | 4e428614677476b55b08b152f122508582795922 (diff) | |
download | meson-ec45c29c9ddd5d848eb1555cdc09246d8900afec.zip meson-ec45c29c9ddd5d848eb1555cdc09246d8900afec.tar.gz meson-ec45c29c9ddd5d848eb1555cdc09246d8900afec.tar.bz2 |
Add rpath entries for all found libraries outside of system libraries.
Diffstat (limited to 'mesonbuild/backend/backends.py')
-rw-r--r-- | mesonbuild/backend/backends.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index c737d49..e0e2abc 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -303,13 +303,16 @@ class Backend: for dep in target.external_deps: if isinstance(dep, dependencies.ExternalLibrary): la = dep.link_args - if len(la) == 1 and la[0].startswith(self.environment.get_source_dir()): + if len(la) == 1 and os.path.isabs(la[0]): # The only link argument is an absolute path to a library file. libpath = la[0] + if libpath.startswith(('/usr/lib', '/lib')): + # No point in adding system paths. + continue 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:] + rel_to_src = absdir[len(self.environment.get_source_dir()) + 1:] assert(not os.path.isabs(rel_to_src)) paths.append(os.path.join(self.build_to_src, rel_to_src)) return paths @@ -321,7 +324,9 @@ class Backend: prospective = self.get_target_dir(ld) if prospective not in result: result.append(prospective) - result += self.rpaths_for_bundled_shared_libraries(target) + for rp in self.rpaths_for_bundled_shared_libraries(target): + if rp not in result: + result += [rp] return result def object_filename_from_source(self, target, source, is_unity): |