Different colour for warning versus error in build window with CMake

已回答

It is very difficult to quickly differentiate between build errors and warnings or notes in the build window.

There are 2 warnings, 3 notes and one error in the image above but finding he error is not easy, especially if this output is many pages long.

You can change the colour in Settings->Editor->Color Scheme->Console Colors->Console->Error output
How can you set a different colour for note, warning and error?

1

Thanks for the response.

After a lot more digging I have found that the colours are actually controlled by the compiler and you can influence that by providing config to the compiler.

See https://apimirror.com/gcc~7/diagnostic-message-formatting-options

So in my case adding

add_compile_options(-fdiagnostics-color=always)

to CMakeList.txt solved my problem.
Hope it helps someone else.

0

Thanks a lot for sharing the solution!

0

请先登录再写评论。