mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 15:51:12 +00:00
Build WASI libc using Zig, instead of using a checked-in binary
This commit is contained in:
parent
de7fbc3fb9
commit
dd1d49db75
7 changed files with 102 additions and 10 deletions
|
@ -72,16 +72,12 @@ fn find_zig_str_path() -> PathBuf {
|
|||
}
|
||||
|
||||
fn find_wasi_libc_path() -> PathBuf {
|
||||
let wasi_libc_path = PathBuf::from("compiler/builtins/bitcode/wasi-libc.a");
|
||||
|
||||
if std::path::Path::exists(&wasi_libc_path) {
|
||||
return wasi_libc_path;
|
||||
}
|
||||
|
||||
// when running the tests, we start in the /cli directory
|
||||
let wasi_libc_path = PathBuf::from("../compiler/builtins/bitcode/wasi-libc.a");
|
||||
if std::path::Path::exists(&wasi_libc_path) {
|
||||
return wasi_libc_path;
|
||||
// Environment variable defined in wasi-libc-sys/build.rs
|
||||
if let Ok(wasi_libc_path) = std::env::var("WASI_LIBC_SYS_PATH") {
|
||||
let wasi_libc_pathbuf = PathBuf::from(&wasi_libc_path);
|
||||
if std::path::Path::exists(&wasi_libc_pathbuf) {
|
||||
return wasi_libc_pathbuf;
|
||||
}
|
||||
}
|
||||
|
||||
panic!("cannot find `wasi-libc.a`")
|
||||
|
|
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue