简体   繁体   中英

waf: how to use extra tools and how to distribute project?

I am using waf in windows and I cannot figure out how to use the boost tool.

I tried waf update , but it says the following:

Could not find the tool in the remote repository 'update' finished successfully (0.597s)

  1. How can I use the boost tool (or any) in extras?
  2. How should I distribute my project? I saw waf-light --tools=compat15,boost and things like that.

1) In the Waf Book you can find different examples of this.

Under section "3.2.2. Loading and using Waf tools", you'll see that they load the tool 'dang.py' from a folder '.' by using:

def configure(ctx):
     ctx.load('dang', tooldir='.')

When it loads dang.py it will also call the 'configure' function inside it. Same goes for 'options', 'build' etc.

Another example is using the extras ("11.1.2. Build visualization"):

def configure(ctx):
    ctx.load('parallel_debug', tooldir='waf-1.7.13/waflib/extras')


2) When distributing, I always use vanilla waf, and instead provide the wscripts and tools files.

But if you do run that command line:

waf-light --tools=compat15,boost

you'll get a waf executable that has the tools built in. You can distribute that exe if I understand it correctly.

Note that you still need to load the tools as usual

ctx.load('boost')

In order to use the boost tool, this is the way to go:

waf update --files=boost

That will upload the extra tool boost.

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