Skip to content

Commit

Permalink
add an error message for targets that are not dependencies
Browse files Browse the repository at this point in the history
mmomtchev authored and dcbaker committed Apr 22, 2024

Verified

This commit was signed with the committer’s verified signature.
samdeane Sam Deane
1 parent 0cec1c0 commit 2868982
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mesonbuild/modules/cmake.py
Original file line number Diff line number Diff line change
@@ -136,6 +136,8 @@ def dependency(self, state: ModuleState, args: T.List[str], kwargs: T.Dict[str,
info = self._args_to_info(args)
if info['func'] == 'executable':
raise InvalidArguments(f'{args[0]} is an executable and does not support the dependency() method. Use target() instead.')
if info['dep'] is None:
raise InvalidArguments(f'{args[0]} does not support the dependency() method. Use target() instead.')
orig = self.get_variable(state, [info['dep']], {})
assert isinstance(orig, dependencies.Dependency)
actual = orig.include_type

0 comments on commit 2868982

Please sign in to comment.