waf --apiscan will no longer try to abort waf build at the end of scanning, to avoid the waf hang. Fixes #1622.

This commit is contained in:
Gustavo Carneiro
2013-10-13 17:54:19 +01:00
parent 4578107371
commit f0b9a19317

View File

@@ -310,7 +310,7 @@ def get_module_path(bld, module):
raise ValueError("Module %r not found" % module)
return ns3headers.path.abspath()
class apiscan_task(Task.TaskBase):
class apiscan_task(Task.Task):
"""Uses gccxml to scan the file 'everything.h' and extract API definitions.
"""
after = 'gen_ns3_module_header ns3header'
@@ -318,7 +318,7 @@ class apiscan_task(Task.TaskBase):
color = "BLUE"
def __init__(self, curdirnode, env, bld, target, cflags, module):
self.bld = bld
super(apiscan_task, self).__init__(generator=self)
super(apiscan_task, self).__init__(generator=self, env=env)
self.curdirnode = curdirnode
self.env = env
self.target = target
@@ -341,6 +341,8 @@ class apiscan_task(Task.TaskBase):
return self.uid_
def run(self):
self.inputs = [self.bld.bldnode.find_resource("ns3/{0}-module.h".format(self.module))]
self.outputs = [self.bld.srcnode.find_resource("src/{}/bindings/modulegen__{}.py".format(self.module, self.target))]
top_builddir = self.bld.bldnode.abspath()
module_path = get_module_path(self.bld, self.module)
headers_map = get_headers_map(self.bld)
@@ -393,30 +395,6 @@ def get_modules_and_headers(bld):
class python_scan_task_collector(Task.TaskBase):
"""Tasks that waits for the python-scan-* tasks to complete and then signals WAF to exit
"""
after = 'apiscan'
before = 'cxx'
color = "BLUE"
def __init__(self, curdirnode, env, bld):
self.bld = bld
super(python_scan_task_collector, self).__init__(generator=self)
self.curdirnode = curdirnode
self.env = env
def display(self):
return 'python-scan-collector\n'
def run(self):
# signal stop (we generated files into the source dir and WAF
# can't cope with it, so we have to force the user to restart
# WAF)
self.bld.producer.stop = 1
return 0
class gen_ns3_compat_pymod_task(Task.Task):
"""Generates a 'ns3.py' compatibility module."""
before = 'cxx'
@@ -479,7 +457,6 @@ def build(bld):
group = bld.get_group(bld.current_group)
for module in scan_modules:
group.append(apiscan_task(bld.path, env, bld, target, cflags, module))
group.append(python_scan_task_collector(bld.path, env, bld))
return