Modular bindings: add support for the apiscan target 'all', that means scan all ns-3 modules

This commit is contained in:
Gustavo J. A. M. Carneiro
2011-03-20 15:41:43 +00:00
parent 259cf3703b
commit 6a29a6bd0a

View File

@@ -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