When building with Scons, I can configure it to use clang like so:
env["CXX"] = "clang++"
However, it doesn't seem to preserve the color information that clang outputs. How can I make scons preserve the color?
According to the clang documentation, color is enabled only when a color-capable terminal is detected. SCons doesn't automatically pass on all environment variables to the process that runs the compiler, you have pass them explicitly. And TERM is not passed on to clang.
Add the following to your SConstruct and color should work again:
import os
env['ENV']['TERM'] = os.environ['TERM']
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With