문제

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?

도움이 되었습니까?

해결책

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'].

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top