From 7b2e7d623b626ed2cae1d4b7f2b5480bdabbefd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Fri, 2 Sep 2022 07:11:24 +0200 Subject: [PATCH] Disable Bazel's env checking on UWP UWP does not support environment variables and so it cannot compile code using getenv. --- src/catch2/catch_config.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/catch2/catch_config.cpp b/src/catch2/catch_config.cpp index 4465831d..4cb3627d 100644 --- a/src/catch2/catch_config.cpp +++ b/src/catch2/catch_config.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -15,8 +16,11 @@ namespace { bool provideBazelReporterOutput() { -#ifdef CATCH_CONFIG_BAZEL_SUPPORT +#if defined(CATCH_CONFIG_BAZEL_SUPPORT) return true; +#elif defined(CATCH_PLATFORM_WINDOWS_UWP) + // UWP does not support environment variables + return false; #else # if defined( _MSC_VER ) @@ -81,6 +85,7 @@ namespace Catch { } ); } +#if !defined(CATCH_PLATFORM_WINDOWS_UWP) if(provideBazelReporterOutput()){ // Register a JUnit reporter for Bazel. Bazel sets an environment // variable with the path to XML output. If this file is written to @@ -102,7 +107,7 @@ namespace Catch { { "junit", std::string( bazelOutputFilePtr ), {}, {} } ); } } - +#endif // We now fixup the reporter specs to handle default output spec, // default colour spec, etc