瀏覽代碼

BUG: Disable color makefile inside try-compile

Generated makefiles for try-compile projects should never use color
output.  On MSYS the color escapes end up in the try-compile output text
because there is no way to identify whether the output is going to a
color-capable terminal.  Instead we should just always skip color for
try-compile projects.
Brad King 16 年之前
父節點
當前提交
04b834f1b4
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      Source/cmLocalUnixMakefileGenerator3.cxx

+ 4 - 1
Source/cmLocalUnixMakefileGenerator3.cxx

@@ -120,7 +120,10 @@ void cmLocalUnixMakefileGenerator3::Generate()
 
 
   // Record whether some options are enabled to avoid checking many
   // Record whether some options are enabled to avoid checking many
   // times later.
   // times later.
-  this->ColorMakefile = this->Makefile->IsOn("CMAKE_COLOR_MAKEFILE");
+  if(!this->GetGlobalGenerator()->GetCMakeInstance()->GetIsInTryCompile())
+    {
+    this->ColorMakefile = this->Makefile->IsOn("CMAKE_COLOR_MAKEFILE");
+    }
   this->SkipPreprocessedSourceRules =
   this->SkipPreprocessedSourceRules =
     this->Makefile->IsOn("CMAKE_SKIP_PREPROCESSED_SOURCE_RULES");
     this->Makefile->IsOn("CMAKE_SKIP_PREPROCESSED_SOURCE_RULES");
   this->SkipAssemblySourceRules =
   this->SkipAssemblySourceRules =