0

I'm trying to build two projects with Waf + MSVC:

top = '.'
out = 'build'

def configure(conf):
    conf.setenv('x86')
    conf.env['MSVC_TARGETS'] = 'x86'
    conf.load('compiler_cxx')

    conf.setenv('x64')
    conf.env['MSVC_TARGETS'] = 'x86_amd64'
    conf.load('compiler_cxx')

def options(opt):
    opt.load('compiler_cxx')

def build(ctx):
    ctx.env = ctx.all_envs['x86']
    ctx.program(source='x86.cpp', target='x86', name='x86')

    ctx.env = ctx.all_envs['x64']
    ctx.program(source='x64.cpp', target='x64', name='x64')

As you can see I build the 32-bit and 64-bit projects using different environments. My question is: how can I set dependencies between the "x64" and "x86" projects? I need the "x86" project to be built after "x64" is done.

I just discovered that the only way to set up the manual dependency is the method add_manual_dependency, but it seems that you can use it only within the single environment. It would be also awesome to know how to implement the "use=['xxx']" method which works good for static libraries, but for my case. Is there any possibility to have automatic dependencies in a such way? For example:

def build(ctx):
    ctx.env = ctx.all_envs['x86']
    ctx.program(source='x86.cpp', target='x86', name='x86', use='x64_from_x64_environment')

    ctx.env = ctx.all_envs['x64']
    ctx.program(source='x64.cpp', target='x64', name='x64')

I would really appreciate any help! :)

1 Answers1

0

I think you must add this after the first target

ctx.add_group()
jj99
  • 300
  • 1
  • 11