Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Not only can you make your compiler output shorter, you can colorcode it, and add a verbose flag. The output will look something like this:</p> <p><a href="http://img526.imageshack.us/img526/9572/sconsf.png">alt text http://img526.imageshack.us/img526/9572/sconsf.png</a></p> <p>Here's how (color theme stolen from the SCons Wiki):</p> <pre><code>import os,sys colors = {} colors['cyan'] = '\033[96m' colors['purple'] = '\033[95m' colors['blue'] = '\033[94m' colors['green'] = '\033[92m' colors['yellow'] = '\033[93m' colors['red'] = '\033[91m' colors['end'] = '\033[0m' #If the output is not a terminal, remove the colors if not sys.stdout.isatty(): for key, value in colors.iteritems(): colors[key] = '' compile_source_message = '%s\nCompiling %s==&gt; %s$SOURCE%s' % \ (colors['blue'], colors['purple'], colors['yellow'], colors['end']) compile_shared_source_message = '%s\nCompiling shared %s==&gt; %s$SOURCE%s' % \ (colors['blue'], colors['purple'], colors['yellow'], colors['end']) link_program_message = '%s\nLinking Program %s==&gt; %s$TARGET%s' % \ (colors['red'], colors['purple'], colors['yellow'], colors['end']) link_library_message = '%s\nLinking Static Library %s==&gt; %s$TARGET%s' % \ (colors['red'], colors['purple'], colors['yellow'], colors['end']) ranlib_library_message = '%s\nRanlib Library %s==&gt; %s$TARGET%s' % \ (colors['red'], colors['purple'], colors['yellow'], colors['end']) link_shared_library_message = '%s\nLinking Shared Library %s==&gt; %s$TARGET%s' % \ (colors['red'], colors['purple'], colors['yellow'], colors['end']) java_compile_source_message = '%s\nCompiling %s==&gt; %s$SOURCE%s' % \ (colors['blue'], colors['purple'], colors['yellow'], colors['end']) java_library_message = '%s\nCreating Java Archive %s==&gt; %s$TARGET%s' % \ (colors['red'], colors['purple'], colors['yellow'], colors['end']) env = Environment() AddOption("--verbose",action="store_true", dest="verbose_flag",default=False,help="verbose output") if not GetOption("verbose_flag"): env["CXXCOMSTR"] = compile_source_message, env["CCCOMSTR"] = compile_source_message, env["SHCCCOMSTR"] = compile_shared_source_message, env["SHCXXCOMSTR"] = compile_shared_source_message, env["ARCOMSTR"] = link_library_message, env["RANLIBCOMSTR"] = ranlib_library_message, env["SHLINKCOMSTR"] = link_shared_library_message, env["LINKCOMSTR"] = link_program_message, env["JARCOMSTR"] = java_library_message, env["JAVACCOMSTR"] = java_compile_source_message, </code></pre> <p>Compile with "scons --verbose" to see the normal bulky gcc output.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload