custom targets: Only add a dependency on absolute path external programs

If the external program is a string that is meant to be searched in
PATH, we can't add a dependency on it at configure time because we don't
know where it will be at compile time.
pull/3463/head
Nirbheek Chauhan 7 years ago committed by Nirbheek Chauhan
parent ec29f19c12
commit 7b2a07bcf9
  1. 6
      mesonbuild/build.py

@ -1713,7 +1713,11 @@ class CustomTarget(Target):
if not c.found(): if not c.found():
m = 'Tried to use not-found external program {!r} in "command"' m = 'Tried to use not-found external program {!r} in "command"'
raise InvalidArguments(m.format(c.name)) raise InvalidArguments(m.format(c.name))
self.depend_files.append(File.from_absolute_file(c.get_path())) path = c.get_path()
if os.path.isabs(path):
# Can only add a dependency on an external program which we
# know the absolute path of
self.depend_files.append(File.from_absolute_file(path))
final_cmd += c.get_command() final_cmd += c.get_command()
elif isinstance(c, (BuildTarget, CustomTarget)): elif isinstance(c, (BuildTarget, CustomTarget)):
self.dependencies.append(c) self.dependencies.append(c)

Loading…
Cancel
Save