windows: Add extension builder support (#9791)

Release Notes:

- N/A
This commit is contained in:
Ezekiel Warren 2024-03-25 14:25:03 -07:00 committed by GitHub
parent 1b4c82dc2c
commit 9b62e461ed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -37,6 +37,8 @@ const WASI_SDK_ASSET_NAME: Option<&str> = if cfg!(target_os = "macos") {
Some("wasi-sdk-21.0-macos.tar.gz")
} else if cfg!(target_os = "linux") {
Some("wasi-sdk-21.0-linux.tar.gz")
} else if cfg!(target_os = "windows") {
Some("wasi-sdk-21.0.m-mingw.tar.gz")
} else {
None
};
@ -371,7 +373,7 @@ impl ExtensionBuilder {
let wasi_sdk_dir = self.cache_dir.join("wasi-sdk");
let mut clang_path = wasi_sdk_dir.clone();
clang_path.extend(["bin", "clang-17"]);
clang_path.extend(["bin", &format!("clang{}", env::consts::EXE_SUFFIX)]);
if fs::metadata(&clang_path).map_or(false, |metadata| metadata.is_file()) {
return Ok(clang_path);