summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2022-04-21 17:18:35 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-04-25 08:02:09 +0000
commit9295f31fee5ee5cef71853ef90235eea642122c5 (patch)
tree9d0cdd0a741377e5b0f7e03231b787e3c94f7151 /cmake
parenta81ae26998f263ca8238a9106b8deb6d219caaf8 (diff)
CMake: Fix interleaved configure output
message(STATUS) prints output to a buffered stdout, whereas message(NOTICE) or just message() print to unbuffered stderr. We use a mix of message() calls when printing the configuration summary, which caused interleaved output. Because CMake offers no message(FLUSH), we work around the issue by calling execute_process(COMMAND -E echo " ") which does call std::cout << s << std::flush; We seem to have to do it twice, before and after the detailed configuration summary is printed. Change-Id: Ibc075551fc0547073f0696477e54d9b9c1edca97 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit dc4bc1e575a6e085f76200f9e4b96c6fb84cf313) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtBuildInformation.cmake5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmake/QtBuildInformation.cmake b/cmake/QtBuildInformation.cmake
index 215bed804f..fc9425160d 100644
--- a/cmake/QtBuildInformation.cmake
+++ b/cmake/QtBuildInformation.cmake
@@ -80,7 +80,12 @@ function(qt_configure_print_summary)
"-- Configure with --log-level=STATUS or higher to increase the output verbosity.")
endif()
+ # Need 2 flushes to ensure no interleaved input is printed due to a mix of message(STATUS)
+ # and message(NOTICE) calls.
+ execute_process(COMMAND ${CMAKE_COMMAND} -E echo " ")
message(STATUS "Configure summary:\n${__qt_configure_reports}")
+ execute_process(COMMAND ${CMAKE_COMMAND} -E echo " ")
+
file(APPEND "${summary_file}" "${__qt_configure_reports}")
endif()
if(__qt_configure_notes)