summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-07-16 17:59:17 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-07-16 17:59:17 (GMT)
commit3573a94d729bb15d2a7c212a29ddbe012acd412b (patch)
tree57afce4dca39b435c31ed2209e0dee42829135c3 /Source
parent41a2fb5ba0df4dd70029e8701c7c3bd407e70032 (diff)
parent45d2966dcc0ebc08a925d6ac2ba1831549faa345 (diff)
downloadCMake-3573a94d729bb15d2a7c212a29ddbe012acd412b.zip
CMake-3573a94d729bb15d2a7c212a29ddbe012acd412b.tar.gz
CMake-3573a94d729bb15d2a7c212a29ddbe012acd412b.tar.bz2
Merge topic 'vs-no-indirect-output'
45d2966 VS: Avoid leaking child process output back to IDE (#14266)
Diffstat (limited to 'Source')
-rw-r--r--Source/cmSystemTools.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index aa5fc94..c52c266 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -1696,6 +1696,7 @@ cmSystemTools::SaveRestoreEnvironment::~SaveRestoreEnvironment()
void cmSystemTools::EnableVSConsoleOutput()
{
+#ifdef _WIN32
// Visual Studio 8 2005 (devenv.exe or VCExpress.exe) will not
// display output to the console unless this environment variable is
// set. We need it to capture the output of these build tools.
@@ -1703,8 +1704,15 @@ void cmSystemTools::EnableVSConsoleOutput()
// either of these executables where NAME is created with
// CreateNamedPipe. This would bypass the internal buffering of the
// output and allow it to be captured on the fly.
-#ifdef _WIN32
cmSystemTools::PutEnv("vsconsoleoutput=1");
+
+# ifdef CMAKE_BUILD_WITH_CMAKE
+ // VS sets an environment variable to tell MS tools like "cl" to report
+ // output through a backdoor pipe instead of stdout/stderr. Unset the
+ // environment variable to close this backdoor for any path of process
+ // invocations that passes through CMake so we can capture the output.
+ cmSystemTools::UnsetEnv("VS_UNICODE_OUTPUT");
+# endif
#endif
}