From c1da999748aade38240f47eee179cdd58c144c78 Mon Sep 17 00:00:00 2001 From: Dan George Date: Fri, 29 Jan 2021 14:07:54 -0800 Subject: [PATCH] cmake: Limit color output to terminals VIm's Quickfix is useless with escape sequences embedded in compiler output. --- cmake/px4_add_common_flags.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/px4_add_common_flags.cmake b/cmake/px4_add_common_flags.cmake index 063f23b63b..699d976641 100644 --- a/cmake/px4_add_common_flags.cmake +++ b/cmake/px4_add_common_flags.cmake @@ -114,8 +114,8 @@ function(px4_add_common_flags) elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.9) - # force color for gcc > 4.9 - add_compile_options(-fdiagnostics-color=always) + # enable color for gcc > 4.9 when stdout is terminal + add_compile_options(-fdiagnostics-color=auto) endif() if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 9.3)