summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-07-21 15:33:57 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-07-21 15:34:04 (GMT)
commite98bfa484f0e36a064fd83fc290751960a9facdd (patch)
tree34180b72814c384451f21326e0910d78a697e400 /Source
parent6e04e06e673f905bc9044a62ff2152cb0f6fa52c (diff)
parentc7a8c9c811678bc7ccfbbfe5013d697ce95fc605 (diff)
downloadCMake-e98bfa484f0e36a064fd83fc290751960a9facdd.zip
CMake-e98bfa484f0e36a064fd83fc290751960a9facdd.tar.gz
CMake-e98bfa484f0e36a064fd83fc290751960a9facdd.tar.bz2
Merge topic 'message-color' into release-3.21
c7a8c9c811 cmMessenger: Revert to non-color messages on Windows Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6369
Diffstat (limited to 'Source')
-rw-r--r--Source/cmakemain.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index 1725375..64d93df 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -153,9 +153,20 @@ std::string cmakemainGetStack(cmake* cm)
void cmakemainMessageCallback(const std::string& m,
const cmMessageMetadata& md, cmake* cm)
{
+#if defined(_WIN32)
+ // FIXME: On Windows we replace cerr's streambuf with a custom
+ // implementation that converts our internal UTF-8 encoding to the
+ // console's encoding. It also does *not* replace LF with CRLF.
+ // Since stderr does not convert encoding and does convert LF, we
+ // cannot use it to print messages. Another implementation will
+ // be needed to print colored messages on Windows.
+ static_cast<void>(md);
+ std::cerr << m << cmakemainGetStack(cm) << "\n";
+#else
cmsysTerminal_cfprintf(md.desiredColor, stderr, "%s", m.c_str());
fflush(stderr); // stderr is buffered in some cases.
std::cerr << cmakemainGetStack(cm) << "\n";
+#endif
}
void cmakemainProgressCallback(const std::string& m, float prog, cmake* cm)