aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/build.py
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/build.py')
-rw-r--r--mesonbuild/build.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index dae94b6..66f08d8 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -1365,8 +1365,17 @@ class GeneratedList:
self.outfilelist = []
self.outmap = {}
self.extra_depends = []
+ self.depend_files = []
self.preserve_path_from = preserve_path_from
self.extra_args = extra_args
+ if isinstance(generator.exe, dependencies.ExternalProgram):
+ if not generator.exe.found():
+ raise InvalidArguments('Tried to use not-found external program as generator')
+ path = generator.exe.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))
def add_preserved_path_segment(self, infile, outfiles, state):
result = []
@@ -1962,8 +1971,7 @@ class CustomTarget(Target):
final_cmd.append(c)
elif isinstance(c, dependencies.ExternalProgram):
if not c.found():
- m = 'Tried to use not-found external program {!r} in "command"'
- raise InvalidArguments(m.format(c.name))
+ raise InvalidArguments('Tried to use not-found external program in "command"')
path = c.get_path()
if os.path.isabs(path):
# Can only add a dependency on an external program which we