Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-7834

Colorize build output with CMake

    • Storage Engines
    • 2
    • 2024-01-09 - I Grew Tired

      Clang & GCC support writing build output with colors e.g. useful for usability such as highlighting compiler errors. Colorized output is usually enabled on Clang and GCC by default when it detects a terminal that supports colors.

      Unfortunately, when compiling with Ninja (generated by CMake), colors are lost. This is since Ninja intercepts the compiler output, and when the compilers detect they're output is not via a terminal, it will drop ANSI color support. We can however manually enable the compilers to use colors regardless with the -fcolor-diagnostics compiler option.

       

      Definition of Done:

      Update CMake to support compiler output colors by adding the -fcolor-diagnostics (Clang) & -fdiagnostics-color=always (GCC) compiler flags. Ideally this will be enabled by a config option that needs to be explicitly set by the user. It wouldn't be ideal to assume the users terminal environment supports colors by default (or the user wants it enabled).

            Assignee:
            mariam.mojid@mongodb.com Mariam Mojid (Inactive)
            Reporter:
            alison.felizzi@mongodb.com Alison Felizzi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: