Being more flexible in when not to explicitly set the sysroot when compiling for WASI (GH-142242)

This commit is contained in:
Brett Cannon 2025-12-03 15:42:10 -08:00 committed by GitHub
parent 547d8daf78
commit c5252045d3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -271,7 +271,7 @@ def wasi_sdk_env(context):
for env_var, binary_name in list(env.items()):
env[env_var] = os.fsdecode(wasi_sdk_path / "bin" / binary_name)
if wasi_sdk_path != pathlib.Path("/opt/wasi-sdk"):
if not wasi_sdk_path.name.startswith("wasi-sdk"):
for compiler in ["CC", "CPP", "CXX"]:
env[compiler] += f" --sysroot={sysroot}"