How to shorten scons compilation output

Viewed 48

Currently i'm compiling my unittests for a big c++ project with scons (2.2.0). The include paths combined has more than 10000 characters. Scons is creating a temp file to handle this, but prints out the includepath for every compiled .c file. I really do not like this and i think it is ugly, i already spent way to much time on this to resolve it but unfortunately i was not able to find a solution. Scons always prints:

Compiling TARGET
Using tempfile c:\users\....\temp\tmpqfgn4z.lnk for command line:
cl ... /I.. /I.. /I.. (in total 10k characters)

i created a small example program to check why the CXXCOMSTR is not working (?)

# SConstruct
env = Environment()
env['CXXCOMSTR'] = "Compiling $TARGET"
env['LINKCOMSTR'] = "Linking $TARGET"

env.Program(["hello.c"])

If I compile this it leads to the following output

# scons -Q    
Compiling hello.obj
hello.c
Linking hello.exe

I have the feeling the 2nd line (hello.c) is the issue. But im not able to get rid of it. my goal is to get just the following output

# scons -Q
Compiling hello.obj
Linking hello.exe

Edit: i found that there is an check in "scons-2.2.0\SCons\Platform_init_.py" to print this line or not. if i change it here manually it is doing what i want. But i cannot share this with other teammembers. Im not able to "import Scons" in my Sconstrict to set this print_actions variable.. Anyone knows how to do that?

if SCons.Action.print_actions:
        print("Using tempfile "+native_tmp+" for command line:\n"+
              str(cmd[0]) + " " + " ".join(args))
1 Answers

This looks like an issue that's been addressed, the current code makes sure the relevant COMSTR variable isn't set before defining an output string mentioning the tempfile usage. A change was made in a commit in 2014, using a version of SCons as old as 2.2 is problematic (and unsupported from the viewpoint of the SCons project).

Related