aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRemi Thebault <remi.thebault@gmail.com>2021-02-28 10:13:31 +0100
committerDylan Baker <dylan@pnwbakers.com>2021-03-02 09:31:40 -0800
commit25848fc05f69a54f63bc816486283a2e74d842a8 (patch)
treef661cbe458f1490cdda18645577ef05a9588e1e6
parent83395940149bc3829a2cb3e6855659318010c3db (diff)
downloadmeson-25848fc05f69a54f63bc816486283a2e74d842a8.zip
meson-25848fc05f69a54f63bc816486283a2e74d842a8.tar.gz
meson-25848fc05f69a54f63bc816486283a2e74d842a8.tar.bz2
fix missing versions with generated source
-rw-r--r--mesonbuild/compilers/d.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/mesonbuild/compilers/d.py b/mesonbuild/compilers/d.py
index 4a6a046..ef261fd 100644
--- a/mesonbuild/compilers/d.py
+++ b/mesonbuild/compilers/d.py
@@ -153,6 +153,9 @@ class DmdLikeCompilerMixin(CompilerMixinBase):
def get_feature_args(self, kwargs: T.Dict[str, T.Any], build_to_src: str) -> T.List[str]:
# TODO: using a TypeDict here would improve this
res = []
+ # get_feature_args can be called multiple times for the same target when there is generated source
+ # so we have to copy the kwargs (target.d_features) dict before popping from it
+ kwargs = kwargs.copy()
if 'unittest' in kwargs:
unittest = kwargs.pop('unittest')
unittest_arg = d_feature_args[self.id]['unittest']
@@ -527,6 +530,9 @@ class DCompiler(Compiler):
def get_feature_args(self, kwargs: T.Dict[str, T.Any], build_to_src: str) -> T.List[str]:
# TODO: using a TypeDict here would improve this
res = []
+ # get_feature_args can be called multiple times for the same target when there is generated source
+ # so we have to copy the kwargs (target.d_features) dict before popping from it
+ kwargs = kwargs.copy()
if 'unittest' in kwargs:
unittest = kwargs.pop('unittest')
unittest_arg = d_feature_args[self.id]['unittest']