wafs include 存储在哪里

Where are wafs include stored

可以在 bld.program.

中使用关键字参数 includes= 在 waf 中提供额外的包含目录
def build(bld):
        bld.program(source='main.c', target='app', includes='.')

现在我需要在功能中获取此 includes= 信息。我这样试过:

class _includes(Task.Task):
    before = ['apply_link']

    def run(self):
        print(self.generator.bld.env.INCLUDES)


@TaskGen.feature('include_feature')
@TaskGen.before('apply_link')
def add_include_feature(self):
    self.create_task('_includes')

但这只是 returns 在 waf configure 期间设置的包含。但是我还需要从关键字参数 includes=.

中获取额外的包含

如何让他们加入任务?

答案很简单,includes存储的信息ins:

class _includes(Task.Task):
    before = ['apply_link']

    def run(self):
        print(self.generator.bld.env.INCLUDES)
        print(self.generator.bld.env.includes)


@TaskGen.feature('include_feature')
@TaskGen.before('apply_link')
def add_include_feature(self):
    self.create_task('_includes')