diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2023-07-19 13:12:30 -0700 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2023-07-20 14:20:46 -0400 |
commit | a62a42b272923f95b7aeb30f0196cfdf3b251264 (patch) | |
tree | 7ae0efcb71defaed1cb8227b20707a7c313da084 /mesonbuild/interpreter/interpreter.py | |
parent | 096869ad63157f666773bd93bd14bdd6bd0602aa (diff) | |
download | meson-a62a42b272923f95b7aeb30f0196cfdf3b251264.zip meson-a62a42b272923f95b7aeb30f0196cfdf3b251264.tar.gz meson-a62a42b272923f95b7aeb30f0196cfdf3b251264.tar.bz2 |
interpreter: use kwarginfo for build_target(target_type)
Which lets us remove a bunch of validation code
Diffstat (limited to 'mesonbuild/interpreter/interpreter.py')
-rw-r--r-- | mesonbuild/interpreter/interpreter.py | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py index 853d858..235f048 100644 --- a/mesonbuild/interpreter/interpreter.py +++ b/mesonbuild/interpreter/interpreter.py @@ -1877,17 +1877,12 @@ class Interpreter(InterpreterBase, HoldableObject): kwargs: kwtypes.BuildTarget ) -> T.Union[build.Executable, build.StaticLibrary, build.SharedLibrary, build.SharedModule, build.BothLibraries, build.Jar]: - if 'target_type' not in kwargs: - raise InterpreterException('Missing target_type keyword argument') - target_type = kwargs.pop('target_type') + target_type = kwargs['target_type'] if target_type == 'executable': return self.build_target(node, args, kwargs, build.Executable) elif target_type == 'shared_library': return self.build_target(node, args, kwargs, build.SharedLibrary) elif target_type == 'shared_module': - FeatureNew.single_use( - 'build_target(target_type: \'shared_module\')', - '0.51.0', self.subproject, location=node) return self.build_target(node, args, kwargs, build.SharedModule) elif target_type == 'static_library': return self.build_target(node, args, kwargs, build.StaticLibrary) @@ -1895,10 +1890,7 @@ class Interpreter(InterpreterBase, HoldableObject): return self.build_both_libraries(node, args, kwargs) elif target_type == 'library': return self.build_library(node, args, kwargs) - elif target_type == 'jar': - return self.build_target(node, args, kwargs, build.Jar) - else: - raise InterpreterException('Unknown target_type.') + return self.build_target(node, args, kwargs, build.Jar) @noPosargs @typed_kwargs( |