diff options
author | Remi Thebault <remi.thebault@gmail.com> | 2022-03-02 23:23:51 +0100 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2022-03-03 08:42:56 -0800 |
commit | 4fe6f0dd2909d768bc764a39e24f16daf6e870e7 (patch) | |
tree | 5019d0ed01c1a21aa555f5d74acc5aab76c01ecc /mesonbuild/interpreter | |
parent | 2bcc204a11073628e95f01181a0b037d81b64178 (diff) | |
download | meson-4fe6f0dd2909d768bc764a39e24f16daf6e870e7.zip meson-4fe6f0dd2909d768bc764a39e24f16daf6e870e7.tar.gz meson-4fe6f0dd2909d768bc764a39e24f16daf6e870e7.tar.bz2 |
add D features to InternalDependency
Diffstat (limited to 'mesonbuild/interpreter')
-rw-r--r-- | mesonbuild/interpreter/interpreter.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py index b2d7224..0bace86 100644 --- a/mesonbuild/interpreter/interpreter.py +++ b/mesonbuild/interpreter/interpreter.py @@ -639,9 +639,10 @@ class Interpreter(InterpreterBase, HoldableObject): @FeatureNewKwargs('declare_dependency', '0.46.0', ['link_whole']) @FeatureNewKwargs('declare_dependency', '0.54.0', ['variables']) + @FeatureNewKwargs('declare_dependency', '0.62.0', ['d_module_versions', 'd_import_dirs']) @permittedKwargs({'include_directories', 'link_with', 'sources', 'dependencies', 'compile_args', 'link_args', 'link_whole', 'version', - 'variables'}) + 'variables', 'd_module_versions', 'd_import_dirs'}) @noPosargs def func_declare_dependency(self, node, args, kwargs): version = kwargs.get('version', self.project_version) @@ -656,6 +657,8 @@ class Interpreter(InterpreterBase, HoldableObject): compile_args = mesonlib.stringlistify(kwargs.get('compile_args', [])) link_args = mesonlib.stringlistify(kwargs.get('link_args', [])) variables = self.extract_variables(kwargs, list_new=True) + d_module_versions = extract_as_list(kwargs, 'd_module_versions') + d_import_dirs = self.extract_incdirs(kwargs, 'd_import_dirs') final_deps = [] for d in deps: if not isinstance(d, (dependencies.Dependency, dependencies.ExternalLibrary, dependencies.InternalDependency)): @@ -667,7 +670,7 @@ class Interpreter(InterpreterBase, HoldableObject): external dependencies (including libraries) must go to "dependencies".''') dep = dependencies.InternalDependency(version, incs, compile_args, link_args, libs, libs_whole, sources, final_deps, - variables) + variables, d_module_versions, d_import_dirs) return dep @typed_pos_args('assert', bool, optargs=[str]) @@ -2407,8 +2410,8 @@ external dependencies (including libraries) must go to "dependencies".''') install_tag=install_tag, data_type='configure')) return mesonlib.File.from_built_file(self.subdir, output) - def extract_incdirs(self, kwargs): - prospectives = extract_as_list(kwargs, 'include_directories') + def extract_incdirs(self, kwargs, key: str = 'include_directories'): + prospectives = extract_as_list(kwargs, key) result = [] for p in prospectives: if isinstance(p, build.IncludeDirs): |