aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-02-03 12:58:55 -0800
committerDylan Baker <dylan@pnwbakers.com>2021-03-26 12:28:42 -0700
commitb1d85f3cde8dfb2942b80c692d1cfa93fbc928eb (patch)
tree987d69206e37dcbc354aeac12455fb02cb002091
parent64775c0fd335c53604a295426d9d6ab4aae24cf8 (diff)
downloadmeson-b1d85f3cde8dfb2942b80c692d1cfa93fbc928eb.zip
meson-b1d85f3cde8dfb2942b80c692d1cfa93fbc928eb.tar.gz
meson-b1d85f3cde8dfb2942b80c692d1cfa93fbc928eb.tar.bz2
modules/external_project: use typed_pos_args
-rw-r--r--mesonbuild/modules/unstable_external_project.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/mesonbuild/modules/unstable_external_project.py b/mesonbuild/modules/unstable_external_project.py
index 2e48611..4d6f712 100644
--- a/mesonbuild/modules/unstable_external_project.py
+++ b/mesonbuild/modules/unstable_external_project.py
@@ -21,7 +21,7 @@ from .. import mlog, build
from ..mesonlib import (MesonException, Popen_safe, MachineChoice,
get_variable_regex, do_replacement, extract_as_list)
from ..interpreterbase import InterpreterObject, InterpreterException, FeatureNew
-from ..interpreterbase import stringArgs, permittedKwargs, typed_pos_args
+from ..interpreterbase import permittedKwargs, typed_pos_args
from ..interpreter import Interpreter, DependencyHolder
from ..compilers.compilers import CFLAGS_MAPPING, CEXE_MAPPING
from ..dependencies.base import InternalDependency, PkgConfigDependency
@@ -37,7 +37,7 @@ class ExternalProject(InterpreterObject):
environment: Environment,
build_machine: str,
host_machine: str,
- configure_command: T.List[str],
+ configure_command: str,
configure_options: T.List[str],
cross_configure_options: T.List[str],
env: build.EnvironmentVariables,
@@ -219,12 +219,9 @@ class ExternalProject(InterpreterObject):
return [self.target, idir]
- @stringArgs
@permittedKwargs({'subdir'})
- def dependency_method(self, args, kwargs):
- if len(args) != 1:
- m = 'ExternalProject.dependency takes exactly 1 positional arguments'
- raise InterpreterException(m)
+ @typed_pos_args('external_project.dependency', str)
+ def dependency_method(self, args: T.Tuple[str], kwargs):
libname = args[0]
subdir = kwargs.get('subdir', '')
@@ -258,9 +255,8 @@ class ExternalProjectModule(ExtensionModule):
self.methods.update({'add_project': self.add_project,
})
- @stringArgs
@permittedKwargs({'configure_options', 'cross_configure_options', 'verbose', 'env'})
- @typed_pos_args('add_project', str)
+ @typed_pos_args('external_project_mod.add_project', str)
def add_project(self, state: ModuleState, args: T.Tuple[str], kwargs: T.Dict[str, T.Any]):
configure_command = args[0]
configure_options = extract_as_list(kwargs, 'configure_options')