diff options
author | Gerald Combs <gerald@wireshark.org> | 2021-04-12 12:13:02 -0700 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2021-04-14 12:42:00 -0700 |
commit | 1dc50f7433e21f1dbb7145c290d7d40ec96ec070 (patch) | |
tree | a927199d61b104ad9e5c505c1505a259ef7ce19a /CMakeOptions.txt | |
parent | cf46f0d74765ef4f49934a83de1c7eb70b73dbd9 (diff) |
CMake+CI: Colorize our compiler output.
As described at
https://medium.com/@alasher/colored-c-compiler-output-with-ninja-clang-gcc-10bfe7f2b949
both Clang and gcc generate colorized output when they detect a
terminal, but not for piped output, which is the case when using Ninja.
Add an ENABLE_COMPILER_COLOR_DIAGNOSTICS CMake option, and set it to
"ON" when we're using Ninja.
In the merge-req:ubuntu-gcc-ctest and merge-req:ubuntu-clang-other-tests
GitLab CI jobs, generate colorized HTML report artifacts using
ansi2html.
Diffstat (limited to 'CMakeOptions.txt')
-rw-r--r-- | CMakeOptions.txt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/CMakeOptions.txt b/CMakeOptions.txt index a651c2ebb6..4c42664645 100644 --- a/CMakeOptions.txt +++ b/CMakeOptions.txt @@ -55,6 +55,12 @@ option(ENABLE_FUZZER "Enable libFuzzer instrumentation for use with fuzzshark" O option(ENABLE_CHECKHF_CONFLICT "Enable hf conflict check for debugging (start-up may be slower)" OFF) option(ENABLE_CCACHE "Speed up compiling and linking using ccache if possible" OFF) +if(CMAKE_GENERATOR STREQUAL "Ninja") + option(ENABLE_COMPILER_COLOR_DIAGNOSTICS "Always enable the compiler's color diagnostic output" ON) +else() + option(ENABLE_COMPILER_COLOR_DIAGNOSTICS "Always enable the compiler's color diagnostic output" OFF) +endif() + if (WIN32) option(ENABLE_LTO "Improves performance using Link time Optimization" ON) else() |