This is an archive of the discontinued LLVM Phabricator instance.

Enable colored diagnostics when building with gcc 4.9+.
ClosedPublic

Authored by thakis on May 18 2018, 11:54 AM.

Details

Reviewers
rnk
Summary

GCC has supported -fdiagnostics-color since 4.9.

Diff Detail

Event Timeline

thakis created this revision.May 18 2018, 11:54 AM

Why do we hardcode compiler IDs/versions here instead of just checking whether the current compiler supports the flag?

It has the same effect and doesn't require yet another compiler call at cmake time, and once we uprev gcc requirements to 4.9 (soooon) we can just delete the whole condition in the parens.

rnk accepted this revision.May 18 2018, 2:17 PM

lgtm

cmake/modules/HandleLLVMOptions.cmake
726–729

Should we simplify these compiler version checks to add_flag_if_supported("-fdiagnostics-color")? We'd still need the UNIX && ninja check.

This revision is now accepted and ready to land.May 18 2018, 2:17 PM
rnk added inline comments.May 18 2018, 2:18 PM
cmake/modules/HandleLLVMOptions.cmake
726–729

Ignore this, I wrote it before you answered @smeenai and only hit submit just now.

thakis closed this revision.May 18 2018, 7:40 PM

r332793, thanks!