aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/ast/introspection.py
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/ast/introspection.py')
-rw-r--r--mesonbuild/ast/introspection.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/mesonbuild/ast/introspection.py b/mesonbuild/ast/introspection.py
index 135ce05..f7d3e20 100644
--- a/mesonbuild/ast/introspection.py
+++ b/mesonbuild/ast/introspection.py
@@ -35,7 +35,12 @@ if T.TYPE_CHECKING:
from ..interpreterbase import TYPE_nvar
from .visitor import AstVisitor
-build_target_functions = ['executable', 'jar', 'library', 'shared_library', 'shared_module', 'static_library', 'both_libraries']
+
+# TODO: it would be nice to not have to duplicate this
+BUILD_TARGET_FUNCTIONS = [
+ 'executable', 'jar', 'library', 'shared_library', 'shared_module',
+ 'static_library', 'both_libraries'
+]
class IntrospectionHelper(argparse.Namespace):
# mimic an argparse namespace
@@ -245,7 +250,7 @@ class IntrospectionInterpreter(AstInterpreter):
continue
arg_nodes = arg_node.arguments.copy()
# Pop the first element if the function is a build target function
- if isinstance(curr, FunctionNode) and curr.func_name in build_target_functions:
+ if isinstance(curr, FunctionNode) and curr.func_name in BUILD_TARGET_FUNCTIONS:
arg_nodes.pop(0)
elemetary_nodes = [x for x in arg_nodes if isinstance(x, (str, StringNode))]
inqueue += [x for x in arg_nodes if isinstance(x, (FunctionNode, ArrayNode, IdNode, ArithmeticNode))]