What could be the simplest way to incorporate Windows WPP Software Tracing into SCons builds?

83 Views Asked by At

I ask my question in such a specific way because I am afraid that a more generic form could lead to excessively theoretic discussions of how the things should be done best and in the most appropriate way (like a question about pre and post-process actions in SCons).

WPP incorporation actually requires execution of an additional command (commands) before compilation of a file and only even if the build process finds necessity to compile the file without any regard to WPP.

I would remark that this is easily achieved with few lines of definitions in a shared Visual Studio property page file making this work for multiple files in multiple projects, folders, etc. in an absolutely transparent for developers way.

Thus I am wondering whether this can be done in a similarly simple way with SCons? I do not have any deep knowledge of either SCons or MSBuild frameworks; I work with them for simple practical use so I would truly appreciate a practical and useful advise.

1

There are 1 best solutions below

6
On

Here's what I'd suggest.

SCons builds command lines from Environment() variables. For example the compile command line for building shared object for c++ is stored in SHCXXCOM (and the variable for what is displayed to user when the command is run defaults to SHCXXCOM, but can be changed by modifying SHCXXCOMSTR).

Back to the problem at hand. Assuming you have a limited number of build steps you want to wrap, you can do something like.

env['SHCXXCOM'] = [ 'MPP PRE COMMAND LINE', env['SHCXXCOM'], 'MPP POST COMMAND LINE']

You'll have to figure out which variables you need to do this with, but take a look at the manpage to figure that out.

https://scons.org/doc/production/HTML/scons-man.html

p.s. I've not tried this, but in theory it should work. Let us know if not.