mirror of
https://gitlab.com/ita1024/waf.git
synced 2024-12-25 02:35:04 +01:00
swig tool can handle -outdir parameter
This commit is contained in:
parent
b45f52165b
commit
533599b7ba
@ -130,12 +130,18 @@ def swig_c(self):
|
||||
|
||||
@swigf
|
||||
def swig_python(tsk):
|
||||
tsk.set_outputs(tsk.inputs[0].parent.find_or_declare(tsk.module + '.py'))
|
||||
node = tsk.inputs[0].parent
|
||||
if tsk.outdir:
|
||||
node = tsk.outdir
|
||||
tsk.set_outputs(node.find_or_declare(tsk.module+'.py'))
|
||||
|
||||
@swigf
|
||||
def swig_ocaml(tsk):
|
||||
tsk.set_outputs(tsk.inputs[0].parent.find_or_declare(tsk.module + '.ml'))
|
||||
tsk.set_outputs(tsk.inputs[0].parent.find_or_declare(tsk.module + '.mli'))
|
||||
node = tsk.inputs[0].parent
|
||||
if tsk.outdir:
|
||||
node = tsk.outdir
|
||||
tsk.set_outputs(node.find_or_declare(tsk.module+'.ml'))
|
||||
tsk.set_outputs(node.find_or_declare(tsk.module+'.mli'))
|
||||
|
||||
@extension(*SWIG_EXTS)
|
||||
def i_file(self, node):
|
||||
@ -147,9 +153,12 @@ def i_file(self, node):
|
||||
flags = self.to_list(getattr(self, 'swig_flags', []))
|
||||
tsk.env.append_value('SWIGFLAGS', flags)
|
||||
|
||||
# looks like this is causing problems
|
||||
#if not '-outdir' in flags:
|
||||
# tsk.env.append_value('SWIGFLAGS', ['-outdir', node.parent.abspath()])
|
||||
tsk.outdir = None
|
||||
if '-outdir' in flags:
|
||||
outdir = flags[flags.index('-outdir')+1]
|
||||
outdir = tsk.generator.bld.bldnode.make_node(outdir)
|
||||
outdir.mkdir()
|
||||
tsk.outdir = outdir
|
||||
|
||||
@conf
|
||||
def check_swig_version(self):
|
||||
|
Loading…
Reference in New Issue
Block a user