mirror of
https://gitlab.com/ita1024/waf.git
synced 2025-01-07 08:55:31 +01:00
Ensure link tasks are processed after swig tasks
This commit is contained in:
parent
3e1e6586e5
commit
ccf5961607
@ -169,7 +169,7 @@ def exec_test_python(bld):
|
|||||||
proc = subprocess.Popen('''
|
proc = subprocess.Popen('''
|
||||||
PYTHONPATH=$PYTHONPATH:build/extend/python
|
PYTHONPATH=$PYTHONPATH:build/extend/python
|
||||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:build/extend/python:build/extend
|
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:build/extend/python:build/extend
|
||||||
python -c "import test_swig_waf; a=test_swig_waf.A(); print 'Testing: a.add(2, 3) ->', a.add(2, 3)"
|
python -c "import test_swig_waf; a=test_swig_waf.A(); print('Testing: a.add(2, 3) -> %r' % a.add(2, 3))"
|
||||||
'''.replace('\n', ' '), shell=True)
|
'''.replace('\n', ' '), shell=True)
|
||||||
proc.wait()
|
proc.wait()
|
||||||
except:
|
except:
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
import re
|
import re
|
||||||
from waflib import Task, Logs
|
from waflib import Task, Logs
|
||||||
from waflib.TaskGen import extension
|
from waflib.TaskGen import extension, feature, after_method
|
||||||
from waflib.Configure import conf
|
from waflib.Configure import conf
|
||||||
from waflib.Tools import c_preproc
|
from waflib.Tools import c_preproc
|
||||||
|
|
||||||
@ -95,6 +95,7 @@ class swig(Task.Task):
|
|||||||
swig_langs = {}
|
swig_langs = {}
|
||||||
def swigf(fun):
|
def swigf(fun):
|
||||||
swig_langs[fun.__name__.replace('swig_', '')] = fun
|
swig_langs[fun.__name__.replace('swig_', '')] = fun
|
||||||
|
return fun
|
||||||
swig.swigf = swigf
|
swig.swigf = swigf
|
||||||
|
|
||||||
def swig_c(self):
|
def swig_c(self):
|
||||||
@ -160,6 +161,18 @@ def i_file(self, node):
|
|||||||
outdir.mkdir()
|
outdir.mkdir()
|
||||||
tsk.outdir = outdir
|
tsk.outdir = outdir
|
||||||
|
|
||||||
|
@feature('c', 'cxx', 'd', 'fc', 'asm')
|
||||||
|
@after_method('apply_link', 'process_source')
|
||||||
|
def enforce_swig_before_link(self):
|
||||||
|
try:
|
||||||
|
link_task = self.link_task
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
for x in self.tasks:
|
||||||
|
if x.__class__.__name__ == 'swig':
|
||||||
|
link_task.run_after.add(x)
|
||||||
|
|
||||||
@conf
|
@conf
|
||||||
def check_swig_version(conf, minver=None):
|
def check_swig_version(conf, minver=None):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user