tags:

views:

152

answers:

1

Hello,

I want to remove from the SCons log the long compiling/linking commands.

I followed what is written on this page : http://stackoverflow.com/questions/890142/what-do-you-do-to-make-compiler-lines-shorter

Here is exactly what I did :

AddOption("--verbose", action="store_true",
           dest="verbose_flag", default=False, help="verbose output")
if not GetOption("verbose_flag"):
        print 'test'
        env['CXXCOMSTR'] = "----- Compiling test ------"
        env['LINKCOMSTR'] = "Linking $TARGET"
print env.Dump()

env.SharedLibrary(..

SCons goes in the if ('test' is printed), and CXXCOMSTR and LINKCOMSTR are updated (checked with Dump()).

But it seems that SCOns just doesn't care : it still prints the full g++ commands.

Thanks for help.

+2  A: 

CXXCOMSTR and LINKCOMSTR are used for static objects, you are building shared ones. Set SHCXXCOMSTR and SHLINKCOMSTR.

PiotrLegnica
Thanks !! You're saving me ! :-)
Oodini
Hmmm... It is OK for gcc, but with Visual Studio remains two lines giving the Visual Studio version and a copyright...
Oodini
Add `/nologo` to compiler and linker flags.
PiotrLegnica
Thanks, it's better !Unfortunately, cl.exe still displays the source file...
Oodini
there is no way to remove that line, cl.exe always print its source file, and no flag can turn it off
David Cournapeau