aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2018-06-30 17:26:46 +0530
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2018-07-01 13:59:48 +0000
commit7b2a07bcf9d3fd00013b51896ff3fe6ea852f114 (patch)
tree24b3e448e30ae9ae8ec669ede93ea3a2408491c1
parentec29f19c1274d72e3a2639e47caf4a7f17ffa436 (diff)
downloadmeson-7b2a07bcf9d3fd00013b51896ff3fe6ea852f114.zip
meson-7b2a07bcf9d3fd00013b51896ff3fe6ea852f114.tar.gz
meson-7b2a07bcf9d3fd00013b51896ff3fe6ea852f114.tar.bz2
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.
-rw-r--r--mesonbuild/build.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index 6e540a8..ec0d8cc 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -1713,7 +1713,11 @@ class CustomTarget(Target):
if not c.found():
m = 'Tried to use not-found external program {!r} in "command"'
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()
elif isinstance(c, (BuildTarget, CustomTarget)):
self.dependencies.append(c)