summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-11-01 14:06:43 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-11-01 14:06:59 (GMT)
commit0deae254e0215fd962130df6cc0f5d22bdc3fdac (patch)
treeee498afaf43763797c92c39d36721297d3b51dde
parent0711a81918ad51084391ec6d992e9c2cd8996445 (diff)
parent2553a78aa74d321ab401e0142b327611e344ee60 (diff)
downloadCMake-0deae254e0215fd962130df6cc0f5d22bdc3fdac.zip
CMake-0deae254e0215fd962130df6cc0f5d22bdc3fdac.tar.gz
CMake-0deae254e0215fd962130df6cc0f5d22bdc3fdac.tar.bz2
Merge topic 'ctest-windows-color'
2553a78aa7 ctest: Allow colored output on Windows if CLICOLOR_FORCE is set to 1 Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8932
-rw-r--r--Source/cmCTest.cxx15
1 files changed, 5 insertions, 10 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index b7232f3..6e684a3 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -2257,11 +2257,6 @@ bool cmCTest::ProgressOutputSupportedByConsole()
bool cmCTest::ColoredOutputSupportedByConsole()
{
-#if defined(_WIN32)
- // Not supported on Windows
- return false;
-#else
- // On UNIX we need a non-dumb tty.
std::string clicolor_force;
if (cmSystemTools::GetEnv("CLICOLOR_FORCE", clicolor_force) &&
!clicolor_force.empty() && clicolor_force != "0") {
@@ -2271,6 +2266,11 @@ bool cmCTest::ColoredOutputSupportedByConsole()
if (cmSystemTools::GetEnv("CLICOLOR", clicolor) && clicolor == "0") {
return false;
}
+#if defined(_WIN32)
+ // Not supported on Windows
+ return false;
+#else
+ // On UNIX we need a non-dumb tty.
return ConsoleIsNotDumb();
#endif
}
@@ -3736,12 +3736,7 @@ void cmCTest::Log(int logType, const char* file, int line, const char* msg,
std::string cmCTest::GetColorCode(Color color) const
{
if (this->Impl->OutputColorCode) {
-#if defined(_WIN32)
- // Not supported on Windows
- static_cast<void>(color);
-#else
return "\033[0;" + std::to_string(static_cast<int>(color)) + "m";
-#endif
}
return "";