[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [creduce-dev] Handrolled LLVM+Clang on Ubuntu 14.04 (Re: towards a release)



On Wed, Mar 16, 2016 at 8:49 AM, Eric Eide <eeide@cs.utah.edu> wrote:
# clang doesn't print colored diagnostics when invoked from Ninja
if (UNIX AND
    CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND
    CMAKE_GENERATOR STREQUAL "Ninja")
  append("-fcolor-diagnostics" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
endif()

Are the code and comment inconsistent?  Why would you not want to print color
diagnostics if you're building with Make?

Clang will print color diagnostics by default if stdout and stderr are TTYs. When you use make, compiler output goes directly to the console. When you use ninja, it is buffered through a pipe, which is not a TTY, so you don't get colors unless you pass this flag to override. Ninja does its own 'isatty' check on stdout, and if false, strips any ANSI color codes so that you don't get mangled output. Go Unix!