I have a waf build script and need to invoke a program which is not officially supported.
#file wscript
def configure(conf):
conf.env.LIB = ['c', 'd']
conf.env.INCLUDES = ['include']
conf.env.LIB_xml2 = ['xml2']
conf.env.INCLUDES_xml2 = ['/usr/include/libxml2']
def build(bld):
bld(rule="dstep ${SRC} -o ${TGT} ${LIB_ST:LIB} ${DINC_ST:INCLUDES}",
use="xml2",
source="header.h",
target="target.d",
)
This expands to dstep header.h -o target.d -lc -ld -I/usr/include/libxml2, so only the global LIB variable works, the use parameter seems to entirely ignored.
How can I make it respect the use parameter?
For waf to process the
usekeyword, you must add theusefeature to your task generator. You also need to add a "compile" aware feature like c, d or cxx. Like this:You can also program specifics for your dstep (You have to define a
dstepfeature and define theUSELIB_VARS["dstep"])Note: See
ccroot.pyin waf code.