diff --git a/lldb/test/Shell/helper/toolchain.py b/lldb/test/Shell/helper/toolchain.py index d9702f21641b6..66f7d33e7de9e 100644 --- a/lldb/test/Shell/helper/toolchain.py +++ b/lldb/test/Shell/helper/toolchain.py @@ -149,7 +149,16 @@ def use_support_substitutions(config): sdk_path = lit.util.to_string(out) llvm_config.lit_config.note("using SDKROOT: %r" % sdk_path) host_flags += ["-isysroot", sdk_path] - elif sys.platform != "win32": + elif sys.platform == "win32": + # Required in SwiftREPL tests + sdk_path = os.environ.get("SDKROOT") + if sdk_path: + llvm_config.lit_config.note(f"using SDKROOT: {sdk_path}") + llvm_config.with_environment("SDKROOT", sdk_path) + else: + llvm_config.lit_config.warning( + "mandatory environment variable not found: SDKROOT") + else: host_flags += ["-pthread"] config.target_shared_library_suffix = (