Questions tagged [waf]

Waf is a Python-based framework for configuring, compiling and installing applications. It derives from the concepts of other build tools such as Scons, Autotools, CMake or Ant. If your question is about AWS WAF, use [amazon-waf] instead. If your question is about web application firewall, use [web-application-firewall] instead.

More information about the Waf project can be found at the following locations.

Help is also available:

  • on the waf-users mailing list
  • on IRC (#waf on freenode, with searchable, archived logs here).
309 questions
1
vote
0 answers

How to compile schema at build step?

Waf 2.0.17 glib2 compiles and install the gsettings schemas of hamster smoothly. Yet it is not possible to run the application without installing first: python3 src/hamster-cli.py (hamster-cli.py:4690): GLib-GIO-ERROR **: 17:27:08.176: Settings…
ederag
  • 2,409
  • 25
  • 49
1
vote
1 answer

How can I create a platform-independent macro to wrap a compiler extension?

I have some code like this that I need to make cross-platform: int __attribute__((noinline)) fn() { return 0; } I want to use Waf to write a config.h that contains #define ATTRIBUTE(attr) __attribute__((attr)) if the compiler supports this…
user2201041
1
vote
1 answer

Automatically reconfigure waf project, if configuration files change

I have a wscript which reads some files during the configure step and based on this sets some variabales. How do I get waf to automatically re-configure the project, if one of the configuration files change, when running waf build instead of waf…
user12176339
1
vote
1 answer

ns3 waf configure headers not found

I have a version of ns-3.26 installed on my VM. Its working fine. However now I need to use very old code and since I dont want to break anything, I downloaded ns-3.26 again and wanted to build it. But the waf configure gives me for this version a…
Fuzzyma
  • 7,619
  • 6
  • 28
  • 60
1
vote
1 answer

Patching class cprogram to accept two targets

I have a implement a custom C compiler tool, but at the last step (linking) I am struggling to get it working. The linker produces to output files, one is the binary, and the second one is some file with additional information. Normally you would…
wafwafwaf
  • 191
  • 9
1
vote
0 answers

Catch waf's run_str output for further processing

I have a task something defined in waf which uses run_str insted of def run(self). How can I catch the output (stdout, stderr and returncode) to further process it. I know I could place it all in in def run(self), start the task manually, catch the…
wafwafwaf
  • 191
  • 9
1
vote
1 answer

Ignoring some flag changes when deciding to rebuild

I'd like to have a C define that represents the timestamp at which my program was last built. For example, something like this: import time bld.program (target = "foo", source = [ "src/foo.c" ], defines = [ time.strftime…
Jmb
  • 18,893
  • 2
  • 28
  • 55
1
vote
1 answer

Setting multiple files as source input generated by a single task generator

A single task generator generates a number of source and header files. The number of generated files is not known at that time. How can I set these generated files as source input? I used the code shown in the documentation, but this only describes…
wafwafwaf
  • 191
  • 9
1
vote
0 answers

Use different Logs in waf

I added a custom logger to the waf build command as seen below. The output of this wscript is shown below. But I want to have the normal waf logger to print on the terminal, and the normal + custom logger output to be written to the log file. Is…
wafwafwaf
  • 191
  • 9
1
vote
1 answer

Waf Task should use variant directory

I am creating files in a Task, the example code looks as follows: from waflib import Task, TaskGen def build(bld): bld(features='write_file') class xyz(Task.Task): def run(self): …
wafwafwaf
  • 191
  • 9
1
vote
1 answer

Waf distcheck not working when with variant builds and/or no Install/Uninstall steps exist

Consider the following wscript: removed install or uninstall commands no build command , but build_debug and build_release commands as we are using a variant build. import waflib from waflib.Build import BuildContext, CleanContext, InstallContext,…
wafwafwaf
  • 191
  • 9
1
vote
1 answer

Where are wafs include stored

It is possible to give bld.program in waf additional include directories with using the keyword argument includes= in bld.program. def build(bld): bld.program(source='main.c', target='app', includes='.') Now I need to get this includes=…
wafwafwaf
  • 191
  • 9
1
vote
1 answer

Create waf size feature

I have created a waf feature to run size on all build files, but I do not want to do it like I orginally wanted (see Custom waf task does neither run nor find sources). So I wrote now a feature, which works generally, but does again not find the…
wafwafwaf
  • 191
  • 9
1
vote
1 answer

Add CleanContext to sphinx_build.py

I am using the a waf-tool to build sphinx documentation from GitHub (see here). How can I add a command like clean_sphinx to that script? I have to add the CleanContext to it, but I do not get how.
wafwafwaf
  • 191
  • 9
1
vote
1 answer

ns-3 waf linking error (undefined references)

I am currently experience problems attempting to use code from the gcrypt library in ns-3 due to a linking error after invoking ./waf. I have installed gcrypt correctly as the below program works fine when compiled with g++ test.cpp -o test…
user1760
  • 13
  • 3