
On 29-1-2014 1:17, Krzysztof KosiĆski wrote:
2014-01-28 Johan Engelen <jbc.engelen@...2592...>:
Random idea: what would be superawesome if we could build a single file, something like:
waf compile --file=johan.cpp --cxxflags="..."
that would only compile (!) johan.cpp with _extra_ cxxflags added. For example to look at assembler/LLVM IR output.
You can say ./waf build --files=src/johan.cpp to compile only that file. (It also works with globs.) The more problematic part is convincing Waf to produce assembly output, because it would require changing the global definition of compilation tasks and disabling the link tasks. However, I think implementing something like this would be possible:
./waf build --assembly-output --files=src/johan.cpp
If you wanted to specify custom flags for some specific files at configure time, that would be easier, but the wscript would have to be written with this functionality in mind. E.g. you would have to define a separate taskgen for each group of files that receives custom flags.
I'm afraid the --assembly-output won't cut it. Because immediately one would want to tweak the compiler flags. I think just being able to do ./waf build --files... is already good enough. You can capture the cmdline invoke of the compiler, and simply use that one line. (compile.lst on Windows already does a good job listing all the commands for example)
So if it is too hard, too bad. I'll make do with what we have already.
Cheers, Johan