From: Orgad Shaneh Date: Wed, 5 Oct 2022 05:41:09 +0000 (+0300) Subject: fix: Capture MSVC stdout/stderr when running from Visual Studio (#1170) X-Git-Tag: v4.7~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c49fca9af83d5744525077719aab529e821f8c02;p=thirdparty%2Fccache.git fix: Capture MSVC stdout/stderr when running from Visual Studio (#1170) --- diff --git a/src/ccache.cpp b/src/ccache.cpp index b065f829a..7884a009b 100644 --- a/src/ccache.cpp +++ b/src/ccache.cpp @@ -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);