aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mintro.py
diff options
context:
space:
mode:
authorDaniel Mensinger <daniel@mensinger-ka.de>2019-02-18 16:43:48 +0100
committerDaniel Mensinger <daniel@mensinger-ka.de>2019-03-03 23:19:03 +0100
commitf9b41d5ecbed3adabb6a0433892ea801b531c412 (patch)
treec5cce47fdc84b426943dbefba99011e7472551a0 /mesonbuild/mintro.py
parent8a1411a1e8a8a2c37de0d25ec129aba65703616e (diff)
downloadmeson-f9b41d5ecbed3adabb6a0433892ea801b531c412.zip
meson-f9b41d5ecbed3adabb6a0433892ea801b531c412.tar.gz
meson-f9b41d5ecbed3adabb6a0433892ea801b531c412.tar.bz2
mintro: Dependencies from source
Diffstat (limited to 'mesonbuild/mintro.py')
-rw-r--r--mesonbuild/mintro.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/mesonbuild/mintro.py b/mesonbuild/mintro.py
index ed74781..349a399 100644
--- a/mesonbuild/mintro.py
+++ b/mesonbuild/mintro.py
@@ -22,7 +22,7 @@ project files and don't need this info."""
import json
from . import build, coredata as cdata
from . import mesonlib
-from .ast import IntrospectionInterpreter, build_target_functions
+from .ast import IntrospectionInterpreter, build_target_functions, AstConditionLevel, AstIDGenerator, AstIndentationGenerator
from . import mlog
from .backend import backends
from .mparser import FunctionNode, ArrayNode, ArgumentNode, StringNode
@@ -63,6 +63,7 @@ def get_meson_introspection_types(coredata: cdata.CoreData = None, builddata: bu
},
'dependencies': {
'func': lambda: list_deps(coredata),
+ 'no_bd': lambda intr: list_deps_from_source(intr),
'desc': 'List external dependencies.',
},
'installed': {
@@ -286,6 +287,12 @@ def list_buildsystem_files(builddata: build.Build):
filelist = [os.path.join(src_dir, x) for x in filelist]
return filelist
+def list_deps_from_source(intr: IntrospectionInterpreter):
+ result = []
+ for i in intr.dependencies:
+ result += [{k: v for k, v in i.items() if k in ['name', 'required', 'has_fallback', 'conditional']}]
+ return result
+
def list_deps(coredata: cdata.CoreData):
result = []
for d in coredata.deps.values():
@@ -377,7 +384,7 @@ def run(options):
# Make sure that log entries in other parts of meson don't interfere with the JSON output
mlog.disable()
backend = backends.get_backend_from_name(options.backend, None)
- intr = IntrospectionInterpreter(sourcedir, '', backend.name)
+ intr = IntrospectionInterpreter(sourcedir, '', backend.name, visitors = [AstIDGenerator(), AstIndentationGenerator(), AstConditionLevel()])
intr.analyze()
# Reenable logging just in case
mlog.enable()