Force colored warnings in ninja's output
ClosedPublic

Authored by elvisangelaccio on Dec 19 2016, 3:39 PM.

Details

Summary

Colored compiler warnings in ninja output only work with the
-fdiagnostics-color=always flag.
See https://github.com/ninja-build/ninja/issues/814 for a rationale.

This patch adds such flag in ecm for gcc >= 4.9 and clang >= 3.5;
I'm not sure which version of clang is the first that supports this flag, but it
cannot be < 3.5 because 3.5 was the first release after gcc 4.9.

Test Plan

ninja+gcc and ninja+clang now show nice colored compiler warnings.

Diff Detail

Repository
R240 Extra CMake Modules
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
elvisangelaccio retitled this revision from to Force colored warnings in ninja's output.
elvisangelaccio updated this object.
elvisangelaccio edited the test plan for this revision. (Show Details)
elvisangelaccio added a reviewer: Frameworks.
kfunk requested changes to this revision.Dec 29 2016, 8:43 AM
kfunk added a reviewer: kfunk.
kfunk added a subscriber: kfunk.

This flag is only needed for Ninja, correct? Thus please check for Ninja in CMAKE_GENERATOR before adding the compiler flag.

This revision now requires changes to proceed.Dec 29 2016, 8:43 AM
elvisangelaccio edited edge metadata.
  • Add color switch only if the generator is Ninja
kfunk accepted this revision.Dec 29 2016, 10:50 AM
kfunk edited edge metadata.

LGTM

This revision is now accepted and ready to land.Dec 29 2016, 10:50 AM
This revision was automatically updated to reflect the committed changes.