[Scons-users] Get list of executed command lines

Kenny, Jason L jason.l.kenny at intel.com
Mon Jan 7 09:15:58 EST 2013


I don't know if this has been fully answered yet but there are two issues you need to be aware of.. some build actions maybe python functions, so there would be no 1:1 mapping for a command line (This may not be an issue for you).

To get the commands SCons would run you command with the --dry-run options. This will have scons run the command it would build based on the current build state, and command line options. These actions are just printed, they are not executed. This output can then be processed to get the commands that would run.

I hope this helps.

Jason

From: scons-users-bounces at scons.org [mailto:scons-users-bounces at scons.org] On Behalf Of Gary Oberbrunner
Sent: Monday, December 24, 2012 9:43 PM
To: SCons users mailing list
Subject: Re: [Scons-users] Get list of executed command lines

Hi Remko; I don't think it's possible to do that, at least it's not easy.

On Mon, Dec 24, 2012 at 4:16 AM, Remko Tronçon <remko at el-tramo.be<mailto:remko at el-tramo.be>> wrote:
Hi all,

Is it possible to get a list of all (actual, or theoretical) executed
command lines out of a SCons build? After I did a SCons build, I would
like to have all C/C++ compiler execution lines for all my source
files (the other command lines don't interest me), so
gcc -o foo.o -c foo.c
gcc -o bar.o -c bar.c
...
(in one form or another).

The naive way would be to do dump SCons' output to a file, and write a
script to parse the output and try to detect compiler invocations, but
it would be a lot easier if I could do this in SCons itself (e.g. by
introspection, or by overriding some execution function to also log
commands to a variable).

Ideally, I would have the list of all compilation lines, including
those that aren't executed (because the sources didn't change), but I
can live with just the actual compilation lines as well, and doing a
clean build everytime.

thanks!
Remko
_______________________________________________
Scons-users mailing list
Scons-users at scons.org<mailto:Scons-users at scons.org>
http://four.pairlist.net/mailman/listinfo/scons-users



--
Gary
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://four.pairlist.net/pipermail/scons-users/attachments/20130107/a68533b2/attachment-0001.html>


More information about the Scons-users mailing list