From 4a2058cb836242a6423870e671b6b76fa48167f3 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Mon, 28 Feb 2022 15:44:39 -0800 Subject: interpreter: use typed_kwargs for subproject() --- mesonbuild/modules/cmake.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'mesonbuild/modules') diff --git a/mesonbuild/modules/cmake.py b/mesonbuild/modules/cmake.py index f996087..a58ad54 100644 --- a/mesonbuild/modules/cmake.py +++ b/mesonbuild/modules/cmake.py @@ -425,11 +425,18 @@ class CmakeModule(ExtensionModule): deprecated_message='Use options instead', ), ) - def subproject(self, state: ModuleState, args: T.Tuple[str], kwargs: Subproject) -> T.Union[SubprojectHolder, CMakeSubproject]: - if kwargs['cmake_options'] and kwargs['options'] is not None: + def subproject(self, state: ModuleState, args: T.Tuple[str], kwargs_: Subproject) -> T.Union[SubprojectHolder, CMakeSubproject]: + if kwargs_['cmake_options'] and kwargs_['options'] is not None: raise InterpreterException('"options" cannot be used together with "cmake_options"') dirname = args[0] - subp = self.interpreter.do_subproject(dirname, 'cmake', kwargs) + kw: kwargs.DoSubproject = { + 'required': kwargs_['required'], + 'options': kwargs_['options'], + 'cmake_options': kwargs_['cmake_options'], + 'default_options': [], + 'version': [], + } + subp = self.interpreter.do_subproject(dirname, 'cmake', kw) if not subp.found(): return subp return CMakeSubproject(subp) -- cgit v1.1