wit-bindgen-rt 0.20.0

Runtime support for the `wit-bindgen` crate
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
fn main() {
    let target_arch = std::env::var("CARGO_CFG_TARGET_ARCH").unwrap_or(String::new());
    let target_family = std::env::var("CARGO_CFG_TARGET_FAMILY").unwrap_or(String::new());

    if target_family != "wasm" {
        return;
    }

    if target_arch != "wasm32" {
        panic!("only wasm32 supports cabi-realloc right now");
    }

    println!("cargo:rustc-link-lib=wit_bindgen_cabi_realloc");
    let cwd = std::env::current_dir().unwrap();
    let cwd = cwd.display();
    println!("cargo:rustc-link-search=native={cwd}/src");
}