1
다른 출력 디렉토리에 다른 프로젝트 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'