One more stop to fixing --enable-modules
This commit is contained in:
26
wscript
26
wscript
@@ -549,24 +549,44 @@ def build(bld):
|
||||
env['NS3_ENABLED_MODULES'] = modules
|
||||
print "Modules to build:", modules
|
||||
|
||||
def exclude_task(bld, task):
|
||||
# ok, so WAF does not provide an API to prevent an
|
||||
# arbitrary task from running; we have to muck around with
|
||||
# WAF internal state, something that might stop working if
|
||||
# WAF is upgraded...
|
||||
bld.all_task_gen.remove(task)
|
||||
for group in bld.task_manager.groups:
|
||||
try:
|
||||
group.tasks_gen.remove(task)
|
||||
except ValueError:
|
||||
pass
|
||||
else:
|
||||
break
|
||||
|
||||
# Exclude the programs other misc task gens that depend on disabled modules
|
||||
for obj in list(bld.all_task_gen):
|
||||
|
||||
# check for ns3moduleheader_taskgen
|
||||
if type(obj).__name__ == 'ns3moduleheader_taskgen':
|
||||
if ("ns3-%s" % obj.module) not in modules:
|
||||
bld.all_task_gen.remove(obj)
|
||||
exclude_task(bld, obj)
|
||||
|
||||
# check for programs
|
||||
if hasattr(obj, 'ns3_module_dependencies'):
|
||||
# this is an NS-3 program (bld.create_ns3_program)
|
||||
for dep in obj.ns3_module_dependencies:
|
||||
if dep not in modules: # prog. depends on a module that isn't enabled?
|
||||
bld.all_task_gen.remove(obj)
|
||||
exclude_task(bld, obj)
|
||||
break
|
||||
|
||||
# disable the modules themselves
|
||||
if hasattr(obj, "is_ns3_module") and obj.name not in modules:
|
||||
bld.all_task_gen.remove(obj)
|
||||
exclude_task(bld, obj)
|
||||
|
||||
# disable the ns3header_taskgen
|
||||
if type(obj).__name__ == 'ns3header_taskgen':
|
||||
if ("ns3-%s" % obj.module) not in modules:
|
||||
exclude_task(bld, obj)
|
||||
|
||||
## Create a single ns3 library containing all enabled modules
|
||||
if env['ENABLE_STATIC_NS3']:
|
||||
|
||||
Reference in New Issue
Block a user