浏览代码

cmSystemTools: Drop unused MakefileColorEcho function

Brad King 5 月之前
父节点
当前提交
d7dbfa22a1
共有 3 个文件被更改,包括 3 次插入39 次删除
  1. 0 32
      Source/cmSystemTools.cxx
  2. 0 4
      Source/cmSystemTools.h
  3. 3 3
      bootstrap

+ 0 - 32
Source/cmSystemTools.cxx

@@ -103,7 +103,6 @@
 #include "cmsys/FStream.hxx"
 #include "cmsys/RegularExpression.hxx"
 #include "cmsys/System.h"
-#include "cmsys/Terminal.h"
 
 #if defined(_WIN32)
 #  include <windows.h>
@@ -3259,37 +3258,6 @@ cmsys::Status cmSystemTools::SetLogicalWorkingDirectory(std::string const& lwd)
   return status;
 }
 
-void cmSystemTools::MakefileColorEcho(int color, char const* message,
-                                      bool newline, bool enabled)
-{
-  // On some platforms (an MSYS prompt) cmsysTerminal may not be able
-  // to determine whether the stream is displayed on a tty.  In this
-  // case it assumes no unless we tell it otherwise.  Since we want
-  // color messages to be displayed for users we will assume yes.
-  // However, we can test for some situations when the answer is most
-  // likely no.
-  int assumeTTY = cmsysTerminal_Color_AssumeTTY;
-  if (cmSystemTools::HasEnv("DART_TEST_FROM_DART") ||
-      cmSystemTools::HasEnv("DASHBOARD_TEST_FROM_CTEST") ||
-      cmSystemTools::HasEnv("CTEST_INTERACTIVE_DEBUG_MODE")) {
-    // Avoid printing color escapes during dashboard builds.
-    assumeTTY = 0;
-  }
-
-  if (enabled && color != cmsysTerminal_Color_Normal) {
-    // Print with color.  Delay the newline until later so that
-    // all color restore sequences appear before it.
-    cmsysTerminal_cfprintf(color | assumeTTY, stdout, "%s", message);
-  } else {
-    // Color is disabled.  Print without color.
-    fprintf(stdout, "%s", message);
-  }
-
-  if (newline) {
-    fprintf(stdout, "\n");
-  }
-}
-
 bool cmSystemTools::GuessLibrarySOName(std::string const& fullPath,
                                        std::string& soname)
 {

+ 0 - 4
Source/cmSystemTools.h

@@ -589,10 +589,6 @@ public:
       contain any '../' path components.  */
   static cmsys::Status SetLogicalWorkingDirectory(std::string const& lwd);
 
-  /** Echo a message in color using KWSys's Terminal cprintf.  */
-  static void MakefileColorEcho(int color, char const* message, bool newLine,
-                                bool enabled);
-
   /** Try to guess the soname of a shared library.  */
   static bool GuessLibrarySOName(std::string const& fullPath,
                                  std::string& soname);

+ 3 - 3
bootstrap

@@ -578,14 +578,14 @@ if ${cmake_system_mingw}; then
     ProcessWin32 \
     String \
     System \
-    Terminal"
+  "
 else
   KWSYS_C_SOURCES="\
     EncodingC \
     ProcessUNIX \
     String \
     System \
-    Terminal"
+  "
 fi
 
 KWSYS_CXX_SOURCES="\
@@ -609,7 +609,7 @@ KWSYS_FILES="\
   String.h \
   System.h \
   SystemTools.hxx \
-  Terminal.h"
+  "
 
 LIBRHASH_C_SOURCES="\
   librhash/algorithms.c \