From 6a29a6bd0aeb8c27032ee1abce61cd8d7e6c731e Mon Sep 17 00:00:00 2001 From: "Gustavo J. A. M. Carneiro" Date: Sun, 20 Mar 2011 15:41:43 +0000 Subject: [PATCH] Modular bindings: add support for the apiscan target 'all', that means scan all ns-3 modules --- bindings/python/wscript | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bindings/python/wscript b/bindings/python/wscript index 7507b34d9..3f3161aea 100644 --- a/bindings/python/wscript +++ b/bindings/python/wscript @@ -68,7 +68,9 @@ def set_options(opt): action="store_true", default=False, dest='python_scan') opt.add_option('--apiscan', - help=("EXPERIMENTAL: Rescan module API, for Python bindings. Needs working GCCXML / pygccxml environment."), + help=("EXPERIMENTAL: Rescan the API for the indicated module(s), for Python bindings. " + "Needs working GCCXML / pygccxml environment. " + "The metamodule 'all' expands to all available ns-3 modules."), default=None, dest='apiscan', metavar="MODULE[,MODULE...]") opt.add_option('--with-pybindgen', help=('Path to an existing pybindgen source tree to use.'), @@ -653,8 +655,13 @@ def build(bld): scan_targets.append(('gcc_ILP32', '')) else: raise Utils.WafError("Cannot scan python bindings for unsupported data model") + if Options.options.apiscan == 'all': + scan_modules = [mod.split('ns3-')[1] for mod in env.NS3_ENABLED_MODULES] + else: + scan_modules = Options.options.apiscan.split(',') + print "Modules to scan: ", scan_modules for target, cflags in scan_targets: - for module in Options.options.apiscan.split(','): + for module in scan_modules: apiscan_task(bld.path, env, bld, target, cflags, module) python_scan_task_collector(bld.path, env, bld) return