1
これに基づいて、異なる出力ディレクトリにwaftで別のvariants
プロジェクトをビルドすることができます。7.2.2。出力ディレクトリの変更/バリアントのコンフィグレーションセット(https://waf.io/book/#_custom_build_outputs)wafビルドバリアントで異なるソースを使用
しかし、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'