Skip to content

Commit 237b096

Browse files
authored
Merge 1b98549 into e8727fc
2 parents e8727fc + 1b98549 commit 237b096

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

mesonbuild/backend/backends.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1141,9 +1141,21 @@ def create_test_serialisation(self, tests: T.List['Test']) -> T.List[TestSeriali
11411141
cmd_args.extend(self.construct_target_rel_paths(a, t.workdir))
11421142
else:
11431143
raise MesonException('Bad object in test command.')
1144+
1145+
t_env = t.env
1146+
if not machine.is_windows() and not machine.is_cygwin() and not machine.is_darwin():
1147+
ld_lib_path: T.Set[str] = set()
1148+
for d in depends:
1149+
if isinstance(d, build.BuildTarget):
1150+
for l in d.get_all_link_deps():
1151+
if isinstance(l, build.SharedLibrary):
1152+
ld_lib_path.add(os.path.join(self.environment.get_build_dir(), l.get_subdir()))
1153+
if ld_lib_path:
1154+
t_env.prepend('LD_LIBRARY_PATH', list(ld_lib_path), ':')
1155+
11441156
ts = TestSerialisation(t.get_name(), t.project_name, t.suite, cmd, is_cross,
11451157
exe_wrapper, self.environment.need_exe_wrapper(),
1146-
t.is_parallel, cmd_args, t.env,
1158+
t.is_parallel, cmd_args, t_env,
11471159
t.should_fail, t.timeout, t.workdir,
11481160
extra_paths, t.protocol, t.priority,
11491161
isinstance(exe, build.Target),

0 commit comments

Comments
 (0)