summaryrefslogtreecommitdiff
path: root/mesonbuild/backend/backends.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2019-01-06 02:58:53 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2019-01-06 03:00:12 +0200
commit293493f605a38bf12de45c6716d559b2be0226d7 (patch)
tree8402ef7f43b33e0127b86796185976631717a720 /mesonbuild/backend/backends.py
parent31e1a310309f6a3c46ff837414f70ee120397565 (diff)
downloadmeson-wdpath.tar.gz
Calculate target paths correctly when workdir is set.wdpath
Diffstat (limited to 'mesonbuild/backend/backends.py')
-rw-r--r--mesonbuild/backend/backends.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index e8adc99de..23923a362 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -725,7 +725,7 @@ class Backend:
elif isinstance(a, str):
cmd_args.append(a)
elif isinstance(a, build.Target):
- cmd_args.append(self.get_target_filename(a))
+ cmd_args.append(self.construct_target_rel_path(a, t.workdir))
else:
raise MesonException('Bad object in test command.')
ts = TestSerialisation(t.get_name(), t.project_name, t.suite, cmd, is_cross,
@@ -734,6 +734,13 @@ class Backend:
arr.append(ts)
pickle.dump(arr, datafile)
+ def construct_target_rel_path(self, a, workdir):
+ if workdir is None:
+ return self.get_target_filename(a)
+ assert(os.path.isabs(workdir))
+ abs_path = self.get_target_filename_abs(a)
+ return os.path.relpath(abs_path, workdir)
+
def generate_depmf_install(self, d):
if self.build.dep_manifest_name is None:
return