From b1898fd13959cbd49987efedef68a38ab9abb464 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Wed, 9 Nov 2016 03:04:37 +0530 Subject: ninja: Pass absolute path of files to run targets We already pass everything else (custom targets, build targets, etc) as absolute paths, and this is the only sane way to handle this till we rework the codebase to use File objects everywhere (after reworking the File object itself). Fixes https://github.com/mesonbuild/meson/issues/957 --- mesonbuild/backend/ninjabackend.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 8329b59..5fa7d79 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -515,10 +515,10 @@ int dummy; arg_strings.append(os.path.join(self.environment.get_build_dir(), relfname)) deps.append(relfname) elif isinstance(i, mesonlib.File): - arg_strings.append(i.rel_to_builddir(self.build_to_src)) + relfname = i.rel_to_builddir(self.build_to_src) + arg_strings.append(os.path.join(self.environment.get_build_dir(), relfname)) else: - mlog.debug(str(i)) - raise MesonException('Unreachable code in generate_run_target.') + raise AssertionError('Unreachable code in generate_run_target: ' + str(i)) elem = NinjaBuildElement(self.all_outputs, target.name, 'CUSTOM_COMMAND', []) cmd = runnerscript + [self.environment.get_source_dir(), self.environment.get_build_dir(), target.subdir] texe = target.command -- cgit v1.1