]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
fix: Capture MSVC stdout/stderr when running from Visual Studio (#1170)
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>
Wed, 5 Oct 2022 05:41:09 +0000 (08:41 +0300)
committerGitHub <noreply@github.com>
Wed, 5 Oct 2022 05:41:09 +0000 (07:41 +0200)
src/ccache.cpp

index b065f829a10d401e957b7afe074e463a6b28d87c..7884a009b250aafc1a9f70366ba8363559d8e06d 100644 (file)
@@ -2266,6 +2266,12 @@ do_cache_compilation(Context& ctx, const char* const* argv)
 
   TRY(set_up_uncached_err());
 
+  // VS_UNICODE_OUTPUT prevents capturing stdout/stderr, as the output is sent
+  // directly to Visual Studio.
+  if (ctx.config.compiler_type() == CompilerType::msvc) {
+    Util::unsetenv("VS_UNICODE_OUTPUT");
+  }
+
   for (const auto& name : {"DEPENDENCIES_OUTPUT", "SUNPRO_DEPENDENCIES"}) {
     if (getenv(name)) {
       LOG("Unsupported environment variable: {}", name);