简体   繁体   中英

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/wscript so 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')

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM