From 1dc26def9dd0b5a9e7ea16b0b7f99a26950276a4 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Sun, 23 Aug 2015 21:14:18 +0300 Subject: [PATCH] Introspect prints external dependency args. --- mesonintrospect.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/mesonintrospect.py b/mesonintrospect.py index 1c0c7b0d5..ffdd3200f 100755 --- a/mesonintrospect.py +++ b/mesonintrospect.py @@ -37,6 +37,8 @@ parser.add_argument('--buildoptions', action='store_true', dest='buildoptions', help='List all build options.') parser.add_argument('--tests', action='store_true', dest='tests', default=False, help='List all unit tests.') +parser.add_argument('--dependencies', action='store_true', dest='dependencies', default=False, + help='list external dependencies.') parser.add_argument('args', nargs='+') def list_targets(coredata, builddata): @@ -137,6 +139,15 @@ def list_buildsystem_files(coredata, builddata): filelist.append(os.path.relpath(os.path.join(root, f), src_dir)) print(json.dumps(filelist)) +def list_deps(coredata): + result = {} + for d in coredata.deps.values(): + if d.found(): + args = {'compile_args': d.get_compile_args(), + 'link_args': d.get_link_args()} + result[d.name] = args + print(json.dumps(result)) + def list_tests(testdata): result = [] for t in testdata: @@ -172,6 +183,8 @@ if __name__ == '__main__': list_buildoptions(coredata, builddata) elif options.tests: list_tests(testdata) + elif options.dependencies: + list_deps(coredata) else: print('No command specified') sys.exit(1)