From 69dc042ec71eba930276a7bfda218fedbbb0193f Mon Sep 17 00:00:00 2001 From: "Gustavo J. A. M. Carneiro" Date: Mon, 14 Jul 2008 11:25:10 +0100 Subject: [PATCH] Make Python bindings depend only on NS-3 modules that have been API-scanned, not all modules. --- bindings/python/wscript | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/bindings/python/wscript b/bindings/python/wscript index 274620a5b..0248bb347 100644 --- a/bindings/python/wscript +++ b/bindings/python/wscript @@ -327,11 +327,24 @@ def build(bld): bindgen.hidden_inputs = ['everything.h', 'ns3modulegen_generated.py', 'ns3modulegen_core_customizations.py'] - for module in get_modules_and_headers().iterkeys(): - bindgen.hidden_inputs.append("ns3_module_%s.py" % module.replace('-', '_')) + + ## Get a list of scanned modules; the set of scanned modules + ## may be smaller than the set of all modules, in case a new + ## ns3 module is being developed which wasn't scanned yet. + scanned_modules = [] + for filename in os.listdir(bindgen.path.abspath()): + m = re.match(r"^ns3_module_(.+)\.py$", filename) + if m is None: + continue + scanned_modules.append(m.group(1)) + + for module in scanned_modules: + bindgen.hidden_inputs.append("ns3_module_%s.py" % module) + bindgen.hidden_outputs = ['ns3module.h'] - for module in get_modules_and_headers().iterkeys(): - bindgen.hidden_outputs.append("ns3_module_%s.cc" % module.replace('-', '_')) + for module in scanned_modules: + bindgen.hidden_outputs.append("ns3_module_%s.cc" % module) + bindgen.prio = 50 bindgen.os_env = dict(os.environ)