Skip to content

Commit 774ca27

Browse files
authored
Merge pull request #9896 from swiftlang/cherrypick-7302c510d6154bcdf0c5b4b8111920226f801c49
[lldb][test] Propagate SDKROOT env var in Shell tests on Windows
2 parents 66583c7 + e5e3a0a commit 774ca27

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

lldb/test/Shell/helper/toolchain.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,16 @@ def use_support_substitutions(config):
219219
sdk_path = lit.util.to_string(out)
220220
llvm_config.lit_config.note("using SDKROOT: %r" % sdk_path)
221221
host_flags += ["-isysroot", sdk_path]
222-
elif sys.platform != "win32":
222+
elif sys.platform == "win32":
223+
# Required in SwiftREPL tests
224+
sdk_path = os.environ.get("SDKROOT")
225+
if sdk_path:
226+
llvm_config.lit_config.note(f"using SDKROOT: {sdk_path}")
227+
llvm_config.with_environment("SDKROOT", sdk_path)
228+
else:
229+
llvm_config.lit_config.warning(
230+
"mandatory environment variable not found: SDKROOT")
231+
else:
223232
host_flags += ["-pthread"]
224233

225234
config.target_shared_library_suffix = (

0 commit comments

Comments
 (0)