Skip to content

Commit

Permalink
[LLDB] Make build.py use uname to set platform
Browse files Browse the repository at this point in the history
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
  • Loading branch information
omjavaid committed Sep 1, 2022
1 parent 4db7832 commit 0e6a71e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lldb/test/Shell/helper/build.py
Expand Up @@ -2,6 +2,7 @@

import argparse
import os
import platform
import shutil
import signal
import subprocess
Expand Down Expand Up @@ -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'
Expand Down

0 comments on commit 0e6a71e

Please sign in to comment.