char/avril

(wip) why'd you have to go and make things so complicaaaaated?

git clone https://git.t4t.associates/char/avril

Charlotte Somrearrange libs into lib and extensions into extsf4a0f5b

main
532 B12 linesraw
1use std::path::PathBuf;
2
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4    println!("cargo:rerun-if-changed=build.rs");
5    if std::env::var("HOST")? != std::env::var("TARGET")? {
6        return Err("Snapshot generation requires a native build (HOST must equal TARGET)".into());
7    }
8    let snapshot = avril_runtime::assembly::create_snapshot()?;
9    let output = PathBuf::from(std::env::var_os("OUT_DIR").ok_or("Missing OUT_DIR")?);
10    std::fs::write(output.join("runtime.snapshot"), snapshot.as_bytes())?;
11    Ok(())
12}