From 371fe92e82ecadede532a211c1ec36f7039268d7 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 27 Aug 2015 16:41:34 -0400 Subject: [PATCH] Makefile: Print color escapes only when necessary Teach cmSystemTools::MakefileColorEcho to use the color printing API only when we actually have a color to print. This avoids printing escape sequences that do not change the text attributes. Since commit v3.3.0-rc1~480^2~4 (Makefile: Fix output during parallel builds, 2015-02-05) we always use this code path to print progress and rule messages even when color is disabled (e.g. in a try_compile). It is important to avoid printing escapes when there is no color because on MSYS we have no isatty and so assume that vt100 escapes are supported, but we do not want to print them when capturing try_compile output. --- Source/cmSystemTools.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index e2adabe..b440a17 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -2331,7 +2331,7 @@ void cmSystemTools::MakefileColorEcho(int color, const char* message, assumeTTY = 0; } - if(enabled) + if(enabled && color != cmsysTerminal_Color_Normal) { // Print with color. Delay the newline until later so that // all color restore sequences appear before it. -- 1.7.10.4