Alessandro Caproni
Alessandro Caproni

Reputation: 83

waf multi projects setup with integration area

I have a folder IntegrationArea and a project, main, composed of 2 sub-projects, a and b, that looks like below:

IntegrationArea

main
  |
  a
    |
    wscript
  |
  b
    |
    wscript
  |
  wscript

Running waf build in main/a builds the artifatcs in a/build. Running waf install from the main/a installs the artifacts from a/build into the IntegrationArea. So, after the build, the artifacts are available for the build of main/b.

How can I write main/wscriptso that running waf build from main results in the followings:

cd a; waf build; waf install
cd ../b; waf build; waf install

I would need main/wscript to contain something like

  bld.cmd=('build install')
  bld.recurse('a b')

Upvotes: 1

Views: 77

Answers (1)

neuro
neuro

Reputation: 15180

I'm not sure I understand your problem. If you have something like:

# wscript in main

def build(bld):
    bld.recurse(["a", "b"])

With:

# wscript in a

def build(bld):
    bld(rule = touch, target = "a")
    bld.install_files("../integration", "a")

def touch(task):
    task.outputs[0].write("done a")

And:

# wscript in b

def build(bld):
    bld(rule = touch, target = "b")
    bld.install_files("../integration", "b")

def touch(task):
    task.outputs[0].write("done b")

You can just go to main directory and start your install:

cd ~/main
waf install

Upvotes: 0

Related Questions