Question

I have a target in waf defined like this:

bld(...,
    target='asdf',
    export_includes='.'
)

I want to get the value of the export_includes for that target (for use in some custom commands).

How do I get it?

Was it helpful?

Solution

Use a custom rule with the features for whatever target you're processing. Ex, let's say I'm processing C:

def print_includes(t):
    print(t.env.INCPATHS)
bld(features='c', use='asdf', rule=print_includes)

The task t's env will contain all relevant environment variables as derived from the bld.env, but with all the additional flags stemming from use-ing the target.

i.e. if I originally had bld.env.INCPATHS == ['old-path' 'other-old-path'], it'll end up being printed out as ['old-path', 'other-old-path', 'export_include_for_asdf_here'].

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top