From 0e6a71e6a3d11f6d9c9664b56f304757edf1c82e Mon Sep 17 00:00:00 2001 From: Muhammad Omair Javaid Date: Wed, 31 Aug 2022 16:33:45 +0500 Subject: [PATCH] [LLDB] Make build.py use uname to set platform This patch makes build helper script build.py to use platform.uname for machine/architecture detection. Visual studio environment when set using various batch files like vcvars*.bat set PLATFORM environment variable however VsDevCmd.bat does not set PLATFORM variable. Differential Revision: https://reviews.llvm.org/D133011 --- lldb/test/Shell/helper/build.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lldb/test/Shell/helper/build.py b/lldb/test/Shell/helper/build.py index 4b1fe239239a2..96684b7b3e669 100755 --- a/lldb/test/Shell/helper/build.py +++ b/lldb/test/Shell/helper/build.py @@ -2,6 +2,7 @@ import argparse import os +import platform import shutil import signal import subprocess @@ -274,7 +275,7 @@ class MsvcBuilder(Builder): def __init__(self, toolchain_type, args): Builder.__init__(self, toolchain_type, args, '.obj') - if os.getenv('PLATFORM') == 'arm64': + if platform.uname().machine.lower() == 'arm64': self.msvc_arch_str = 'arm' if self.arch == '32' else 'arm64' else: self.msvc_arch_str = 'x86' if self.arch == '32' else 'x64'