Author: Muhammad Omair Javaid Date: 2021-11-04T17:42:43+05:00 New Revision: cbd215dfe51df47e020c676a32c2672c573641a8
URL: https://github.com/llvm/llvm-project/commit/cbd215dfe51df47e020c676a32c2672c573641a8 DIFF: https://github.com/llvm/llvm-project/commit/cbd215dfe51df47e020c676a32c2672c573641a8.diff LOG: [LIT] Add win32 PLATFORM env var to test config LIT skips various system environment variables while building test config. It turns out that we require PLATFORM environment variable for detection of x86 vs Arm windows platform. This patch adds system environment variable PLATFORM into LIT test config for detection of win32 Arm platform. Reviewed By: mstorsjo Differential Revision: https://reviews.llvm.org/D113165 Added: Modified: lldb/test/Shell/helper/build.py llvm/utils/lit/lit/llvm/config.py Removed: ################################################################################ diff --git a/lldb/test/Shell/helper/build.py b/lldb/test/Shell/helper/build.py index 5689373d37a51..005f12bc09cf8 100755 --- a/lldb/test/Shell/helper/build.py +++ b/lldb/test/Shell/helper/build.py @@ -277,7 +277,10 @@ class MsvcBuilder(Builder): def __init__(self, toolchain_type, args): Builder.__init__(self, toolchain_type, args, '.obj') - self.msvc_arch_str = 'x86' if self.arch == '32' else 'x64' + if os.getenv('PLATFORM') == 'arm64': + self.msvc_arch_str = 'arm' if self.arch == '32' else 'arm64' + else: + self.msvc_arch_str = 'x86' if self.arch == '32' else 'x64' if toolchain_type == 'msvc': # Make sure we're using the appropriate toolchain for the desired diff --git a/llvm/utils/lit/lit/llvm/config.py b/llvm/utils/lit/lit/llvm/config.py index 7bc4b445b75e0..5231271f8fef9 100644 --- a/llvm/utils/lit/lit/llvm/config.py +++ b/llvm/utils/lit/lit/llvm/config.py @@ -38,7 +38,7 @@ def __init__(self, lit_config, config): # Many tools behave strangely if these environment variables aren't # set. self.with_system_environment( - ['SystemDrive', 'SystemRoot', 'TEMP', 'TMP']) + ['SystemDrive', 'SystemRoot', 'TEMP', 'TMP', 'PLATFORM']) self.use_lit_shell = True global lit_path_displayed _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits