build: Colors and fixes

I didn't notice the colors I've seen on CMake and g++/clang++ are configured by my IDE and not automatic...

Only realized this was the case after @tommypec's message.

This MR enables colored output for g++/clang++ diagnostics and replaces CMake's message implementation with a colored version when needed.

To control the colorization, either set NS3_COLORED_OUTPUT to ON (off by default, since it may behave weirdly with IDEs), or set the environment variable CLICOLOR when configuring CMake.

The ns3 script sets the environment variable by default, providing colored output.

P.S.: Newer CMake versions (>=3.21) supports colored output, but we are supporting from 3.10 onwards.

Update: Fixes #602 (closed) , #585 (closed), #606 (closed)

Update 2: Fixes have been merged separately in commit 72e61051

Edited by Gabriel Ferreira

Merge request reports

Loading