diff options
| author | Momtchil Momtchev <momtchil@momtchev.com> | 2024-03-15 14:22:17 +0100 |
|---|---|---|
| committer | Dylan Baker <dylan@pnwbakers.com> | 2024-04-22 10:04:57 -0700 |
| commit | 286898219ba8d511b56bc11fe8938e6529cf931b (patch) | |
| tree | 6860258ce72107c9b7a9a50f6ad637cc57533e75 | |
| parent | 0cec1c03d8f0d294027a954c5f350ab2911c5b18 (diff) | |
| download | meson-286898219ba8d511b56bc11fe8938e6529cf931b.tar.gz | |
add an error message for targets that are not dependencies
| -rw-r--r-- | mesonbuild/modules/cmake.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/mesonbuild/modules/cmake.py b/mesonbuild/modules/cmake.py index cd5c5f66a..b9161021d 100644 --- a/mesonbuild/modules/cmake.py +++ b/mesonbuild/modules/cmake.py @@ -136,6 +136,8 @@ class CMakeSubproject(ModuleObject): 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 |
