CForgeForceColoredOutput

Force some compilers to always produce ANSI-colored output.

This module creates an option ${CFORGE_PROJECT_PREFIX}_FORCE_COLORED_OUTPUT enabled by default. It can be turned off when colors are not desired.

The supported compilers are GCC and Clang.

This is particularly useful when building with Ninja in combination of GCC or Clang, as ANSI colors are disabled by default in this case.

Credits

This module is heavily inspired on the following Medium post written by Austin Lasher: https://medium.com/@alasher/colored-c-compiler-output-with-ninja-clang-gcc-10bfe7f2b949