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
pull/1011/head
Nirbheek Chauhan 8 years ago
parent 66ec8c4258
commit b1898fd139
  1. 6
      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

Loading…
Cancel
Save