diff --git a/mesonbuild/build.py b/mesonbuild/build.py index d7f3b66c4..a06979cea 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -819,7 +819,8 @@ class BuildTarget(Target): def get_link_dep_subdirs(self): result = OrderedSet() for i in self.link_targets: - result.add(i.get_subdir()) + if not isinstance(i, StaticLibrary): + result.add(i.get_subdir()) result.update(i.get_link_dep_subdirs()) return result diff --git a/run_unittests.py b/run_unittests.py index 820b705b5..aba77d50b 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -7030,6 +7030,13 @@ c = ['{0}'] windows_proof_rmtree(os.path.join(testdir, 'subprojects', 'foo')) os.unlink(wrap_filename) + def test_no_rpath_for_static(self): + testdir = os.path.join(self.common_test_dir, '5 linkstatic') + self.init(testdir) + self.build() + build_rpath = get_rpath(os.path.join(self.builddir, 'prog')) + self.assertIsNone(build_rpath) + class BaseLinuxCrossTests(BasePlatformTests): # Don't pass --libdir when cross-compiling. We have tests that