mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-02 04:09:33 -05:00
VS: Avoid leaking child process output back to IDE (#14266)
The VS IDE sets the environment variable VS_UNICODE_OUTPUT when executing build rules in order to tell MS tools to report output through a back door instead of through stdout/stderr. Unset this variable so that CMake can capture or properly redirect all output from processes it runs even when running inside a VS IDE build environment. This generalizes the special cases fixed by commit80d045b0(When GetPrerequisites.cmake runs dumpbin while running inside the VS IDE..., 2008-05-01) and commit44aff73d(ExternalProject: Avoid bleed-through output when logging, 2011-01-06), so drop special handling of VS_UNICODE_OUTPUT in those instances.
This commit is contained in:
@@ -961,7 +961,7 @@ endif()
|
||||
set(sep ";")
|
||||
endif()
|
||||
endforeach()
|
||||
set(code "set(ENV{VS_UNICODE_OUTPUT} \"\")\n${code}set(command \"${cmd}\")${code_execute_process}")
|
||||
set(code "${code}set(command \"${cmd}\")${code_execute_process}")
|
||||
file(WRITE ${stamp_dir}/${name}-${step}-impl.cmake "${code}")
|
||||
set(command ${CMAKE_COMMAND} "-Dmake=\${make}" "-Dconfig=\${config}" -P ${stamp_dir}/${name}-${step}-impl.cmake)
|
||||
endif()
|
||||
@@ -971,7 +971,6 @@ endif()
|
||||
set(logbase ${stamp_dir}/${name}-${step})
|
||||
file(WRITE ${script} "
|
||||
${code_cygpath_make}
|
||||
set(ENV{VS_UNICODE_OUTPUT} \"\")
|
||||
set(command \"${command}\")
|
||||
execute_process(
|
||||
COMMAND \${command}
|
||||
|
||||
Reference in New Issue
Block a user