diff options
author | Brad King <brad.king@kitware.com> | 2021-07-20 16:56:29 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-07-20 17:30:11 (GMT) |
commit | c7a8c9c811678bc7ccfbbfe5013d697ce95fc605 (patch) | |
tree | c524f300b78aa14a183f13cfb24fb1d1e1b45751 /Tests/RunCMake/message | |
parent | 31ecd3718047874b5eeb939e9608fa1bd386c1a7 (diff) | |
download | CMake-c7a8c9c811678bc7ccfbbfe5013d697ce95fc605.zip CMake-c7a8c9c811678bc7ccfbbfe5013d697ce95fc605.tar.gz CMake-c7a8c9c811678bc7ccfbbfe5013d697ce95fc605.tar.bz2 |
cmMessenger: Revert to non-color messages on Windows
Since commit 0a0a0f8a74 (cmMessenger: Color messages to terminal by
type, 2021-05-18, v3.21.0-rc1~146^2) the message output no longer goes
through our custom streambuf on Windows that converts output encoding.
This can cause messages to be printed with the wrong encoding in a
Windows Console. It also causes messages to have a mix of LF and CRLF
newlines because `stderr` converts LF to CRLF but our custom streambuf
does not.
Revert to using just `cerr` for messages on Windows. Another approach
will be needed to achieve color output on Windows later.
Fixes: #22444
Diffstat (limited to 'Tests/RunCMake/message')
-rw-r--r-- | Tests/RunCMake/message/RunCMakeTest.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/message/newline-script.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/message/newline-stdout.txt | 2 | ||||
-rw-r--r-- | Tests/RunCMake/message/newline.cmake | 9 |
4 files changed, 15 insertions, 0 deletions
diff --git a/Tests/RunCMake/message/RunCMakeTest.cmake b/Tests/RunCMake/message/RunCMakeTest.cmake index 0313ed1..1233838 100644 --- a/Tests/RunCMake/message/RunCMakeTest.cmake +++ b/Tests/RunCMake/message/RunCMakeTest.cmake @@ -1,5 +1,7 @@ include(RunCMake) +run_cmake_script(newline) + run_cmake(defaultmessage) run_cmake(nomessage) run_cmake(message-internal-warning) diff --git a/Tests/RunCMake/message/newline-script.cmake b/Tests/RunCMake/message/newline-script.cmake new file mode 100644 index 0000000..e9e3d5d --- /dev/null +++ b/Tests/RunCMake/message/newline-script.cmake @@ -0,0 +1,2 @@ +message(STATUS "one\ntwo") +message("one\ntwo") diff --git a/Tests/RunCMake/message/newline-stdout.txt b/Tests/RunCMake/message/newline-stdout.txt new file mode 100644 index 0000000..beca44e --- /dev/null +++ b/Tests/RunCMake/message/newline-stdout.txt @@ -0,0 +1,2 @@ +-- out='2d2d206f6e650a74776f0a' +-- err='6f6e650a74776f0a' diff --git a/Tests/RunCMake/message/newline.cmake b/Tests/RunCMake/message/newline.cmake new file mode 100644 index 0000000..97afba4 --- /dev/null +++ b/Tests/RunCMake/message/newline.cmake @@ -0,0 +1,9 @@ +execute_process( + COMMAND "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_LIST_DIR}/newline-script.cmake" + OUTPUT_FILE newline-script-stdout.txt + ERROR_FILE newline-script-stderr.txt + ) +foreach(f out err) + file(READ newline-script-std${f}.txt hex HEX) + message(STATUS "${f}='${hex}'") +endforeach() |