1

I have several targets defined in my top wscript, let's call them build_a, build_b and build_c.

How do I add a function all to my wscript, that builds all these targets (doesn't matter if sequential or in parallel).

So in dummy python code, I expect something like this:

def all():
    tar = ['configure', 'build_a', 'build_b', 'build_c']
neuro
  • 14,948
  • 3
  • 36
  • 59
wafwafwaf
  • 191
  • 9

1 Answers1

1

It's simple to compose commands:

from waflib import Options

def all(bld):
    commands_after = Options.commands
    Options.commands = ['configure', 'build_a', 'build_b', 'build_c']
    Options.commands += commands_after

See https://waf.io/book/#_custom_commands (ยง7.1.2 Command composition)

waf consume Options.commands while processing it. So you can use:

waf all test

# equivalent to waf configure build_a build_b build_c test 
neuro
  • 14,948
  • 3
  • 36
  • 59