From 2046593825d03c348fb09430e38145d92d9d6b94 Mon Sep 17 00:00:00 2001 From: avitex Date: Thu, 21 Oct 2021 17:24:21 +1100 Subject: [PATCH] delete PLATFORM env only if set fixes #8721 --- mesonbuild/mcompile.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mesonbuild/mcompile.py b/mesonbuild/mcompile.py index 536fccbac..ccb2f0baa 100644 --- a/mesonbuild/mcompile.py +++ b/mesonbuild/mcompile.py @@ -224,9 +224,10 @@ def get_parsed_args_vs(options: 'argparse.Namespace', builddir: Path) -> T.Tuple cmd += options.vs_args - # Remove platform from env so that msbuild does not pick x86 platform when solution platform is Win32 + # Remove platform from env if set so that msbuild does not + # pick x86 platform when solution platform is Win32 env = os.environ.copy() - del env['PLATFORM'] + env.pop('PLATFORM', None) return cmd, env