2012-11-29 2 views
3

여러 대상, 여러 플랫폼 및 경우에 따라 여러 아키텍처에 대해 여러 라이브러리를 빌드하는 waf 파일이 있습니다.waf 1.7 : 환경을 어떻게 복사합니까?

def configure(conf): 
    # set up one platform, multiple variants, multiple archs 
    for arch in ['x86', 'x86_64']: 
     for tgt in ['dbg', 'rel']: 
     conf.setenv('platform_' + arch + '_' + tgt) 
     conf.load('gcc') # or some other compiler, such as msvc 
     conf.load('gxx') 
     #set platform arguments 

그러나,이 구성 중에 컴파일러 검색 출력 여러 줄에 웹 애플리케이션 방화벽가 발생합니다

저는 현재 지금과 같은 변종에 대한 WAF 1.7의 문서에 따라 설정 환경을 가지고있다. 또한 동일한 환경에 여러 번 을 자주 설정한다는 의미입니다. 나는 가능하면 예를 들어, 한 번 이렇게 싶습니다

그러나
def configure(conf): 
    # set up platform 
    conf.setenv('platform') 
    conf.load('gcc') 
    conf.load('gxx') 
    # set platform arguments 
    for arch in ['x86', 'x86_64']: 
     for tgt in ['dbg', 'rel']: 
      conf.setenv('platform_' + arch + '_' + tgt, conf.env.derive()) 
      # set specific arguments as needed 

이 conf.env.derive이 얕은 사본이며, conf.env.copy()가 오류를 나에게 '목록'객체를 제공합니다 호출 할 수 없음

어떻게 이것을 1.7에서 수행 할 수 있습니까?

답변

4

대답은 최상위 아키텍처에서 파생 된 다음 분리되어 구성에 플래그를 더 추가 할 수 있도록합니다. 예 :

def configure(conf): 
    conf.setenv('platform') 
    conf.load('gcc') 
    conf.load('gxx') 
    for arch, tgt in itertools.product(['x86', 'x86_64'], ['dbg', 'rel']): 
     conf.setenv('platform') 
     new_env = conf.env.derive() 
     new_env.detach() 
     conf.setenv('platform_' + arch + '_' + tgt, new_env) 
     # Set architecture/target specifics 
관련 문제