aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreterbase/interpreterbase.py
diff options
context:
space:
mode:
authorDaniel Mensinger <daniel@mensinger-ka.de>2021-06-25 21:14:27 +0200
committerDaniel Mensinger <daniel@mensinger-ka.de>2021-06-26 12:49:35 +0200
commit8f7343831bb78e6801c93cd45e4edfeed65bc437 (patch)
treee90a37ac9b27584b8c43a32779330705973def02 /mesonbuild/interpreterbase/interpreterbase.py
parentb95d6e319f18389c3a11408481335955bdff4e36 (diff)
downloadmeson-8f7343831bb78e6801c93cd45e4edfeed65bc437.zip
meson-8f7343831bb78e6801c93cd45e4edfeed65bc437.tar.gz
meson-8f7343831bb78e6801c93cd45e4edfeed65bc437.tar.bz2
refactor: Refactor BothLibraries logic
This commit introduces a new type of `HoldableObject`: The `SecondLevelHolder`. The primary purpose of this class is to handle cases where two (or more) `HoldableObject`s are stored at the same time (with one default object). The best (and currently only) example here is the `BothLibraries` class.
Diffstat (limited to 'mesonbuild/interpreterbase/interpreterbase.py')
-rw-r--r--mesonbuild/interpreterbase/interpreterbase.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/mesonbuild/interpreterbase/interpreterbase.py b/mesonbuild/interpreterbase/interpreterbase.py
index 3ea10f4..3f5726b 100644
--- a/mesonbuild/interpreterbase/interpreterbase.py
+++ b/mesonbuild/interpreterbase/interpreterbase.py
@@ -42,7 +42,7 @@ from .exceptions import (
from .decorators import FeatureNew, builtinMethodNoKwargs
from .disabler import Disabler, is_disabled
-from .helpers import check_stringlist, default_resolve_key, flatten
+from .helpers import check_stringlist, default_resolve_key, flatten, resolve_second_level_holders
from ._unholder import _unholder
import os, copy, re
@@ -546,6 +546,8 @@ The result of this is undefined and will become a hard error in a future Meson r
func_args = posargs
if not getattr(func, 'no-args-flattening', False):
func_args = flatten(posargs)
+ if not getattr(func, 'no-second-level-holder-flattening', False):
+ func_args, kwargs = resolve_second_level_holders(func_args, kwargs)
res = func(node, func_args, kwargs)
return self._holderify(res)
else: