mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
cmake: enable CMAKE_COLOR_DIAGNOSTICS by default
Related to https://github.com/espressif/esp-idf/issues/4162 Setting this option informs CMake that it should pass -fcolor-diagnostics flag to the compiler. (Colorized build system output, like from GNU Make, is produced even without this flag.) Note that if the build is done using Ninja and the build output is redirected (not a TTY), Ninja will still strip the escape codes from the output. For the case of idf.py, this is handled in the next commit.
This commit is contained in:
parent
e40b83c16f
commit
1ffbee27e7
@ -344,6 +344,12 @@ macro(project project_name)
|
||||
# Generate compile_commands.json (needs to come after project call).
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
# If CMAKE_COLOR_DIAGNOSTICS not set in project CMakeLists.txt or in the environment,
|
||||
# enable it by default.
|
||||
if(NOT DEFINED CMAKE_COLOR_DIAGNOSTICS AND NOT DEFINED ENV{CMAKE_COLOR_DIAGNOSTICS})
|
||||
set(CMAKE_COLOR_DIAGNOSTICS ON)
|
||||
endif()
|
||||
|
||||
# Since components can import third-party libraries, the original definition of project() should be restored
|
||||
# before the call to add components to the build.
|
||||
function(project)
|
||||
|
Loading…
Reference in New Issue
Block a user