From cd906e1c124b03d7f314985151fd17dc7b07c98b Mon Sep 17 00:00:00 2001 From: Ouassim Karrakchou Date: Sun, 14 Jun 2020 16:19:41 -0700 Subject: [PATCH] visualizer: (fixes #199) Include bindings of visualizer dependencies --- src/wscript | 13 ++++++++----- wscript | 8 ++++++++ 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/wscript b/src/wscript index 0bfb408fb..7ad081276 100644 --- a/src/wscript +++ b/src/wscript @@ -192,10 +192,6 @@ def ns3_python_bindings(bld): Warning, stacklevel=2) return - if ("ns3-%s" % (module,)) not in env.NS3_ENABLED_MODULES: - #print "bindings for module %s which is not enabled, skip" % module - return - env.append_value('PYTHON_MODULES_BUILT', module) try: apidefs = env['PYTHON_BINDINGS_APIDEFS'].replace("-", "_") @@ -253,14 +249,21 @@ def ns3_python_bindings(bld): bindgen.env['FEATURES'] = ','.join(features) bindgen.dep_vars = ['FEATURES', "GCC_RTTI_ABI_COMPLETE"] bindgen.name = "pybindgen(ns3 module %s)" % module + bindgen.module = module bindgen.install_path = None + # Retrieve the module dependencies + module_obj = bld.get_tgen_by_name('ns3-' + module) + module_deps = module_obj.use.copy() + module_deps.append('ns3-' + module) + # generate the extension module pymod = bld(features='cxx cxxshlib pyext') pymod.source = ['bindings/ns3module.cc'] pymod.target = '%s/%s' % (module_target_dir, extension_name) pymod.name = 'ns3module_%s' % module - pymod.use = ["%s" % mod for mod in pymod.env['NS3_ENABLED_MODULES']] # Should be '"ns3-"+module', but see bug 1117 + pymod.module= module + pymod.use = module_deps # Should be '"ns3-"+module', but see bug 1117 if pymod.env['ENABLE_STATIC_NS3']: if sys.platform == 'darwin': pymod.env.append_value('LINKFLAGS', '-Wl,-all_load') diff --git a/wscript b/wscript index e162738cf..886b83299 100644 --- a/wscript +++ b/wscript @@ -1012,6 +1012,14 @@ def build(bld): if obj.module not in bld.env.NS3_ENABLED_MODULES and obj.module not in bld.env.NS3_ENABLED_CONTRIBUTED_MODULES: bld.exclude_taskgen(obj) + # disable python bindings for disabled modules + if 'pybindgen' in obj.name: + if ("ns3-%s" % obj.module) not in modules and ("ns3-%s" % obj.module) not in contribModules: + bld.exclude_taskgen(obj) + if 'pyext' in getattr(obj, "features", []): + if ("ns3-%s" % obj.module) not in modules and ("ns3-%s" % obj.module) not in contribModules: + bld.exclude_taskgen(obj) + if env['NS3_ENABLED_MODULES']: env['NS3_ENABLED_MODULES'] = list(modules)