【发布时间】:2017-11-20 16:01:57
【问题描述】:
基于此可以在waf中构建不同的项目variants到不同的输出目录7.2.2。更改变体的输出目录/配置集 (https://waf.io/book/#_custom_build_outputs)
但我不明白如何根据variant 包含不同的文件或目录。
我像这样修改了 waf-book 中的示例,但我缺少如何构建不同的源文件或包含来自不同目录的文件。
def configure(ctx):
pass
def build(ctx):
if not ctx.variant:
ctx.fatal('call "waf a" or "waf b", and try "waf --help"')
# for variant "a" it should build "a.c" and fpr "b" it should build "b.c"
# for a: bld.program(source='a.c', target='app', includes='.')
# for b: bld.program(source='b.c', target='app', includes='.')
from waflib.Build import BuildContext
class a(BuildContext):
cmd = 'a'
variant = 'a'
from waflib.Build import BuildContext
class b(BuildContext):
cmd = 'b'
variant = 'b'
【问题讨论】: