I want to remove from the SCons log the long compiling/linking commands.
I followed what is written on this page : 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.
CXXCOMSTR
and LINKCOMSTR
are used for static objects, you are building shared ones. Set SHCXXCOMSTR
and SHLINKCOMSTR
.
精彩评论