Files
wasmtime/crates/runtime/build.rs
Alex Crichton 724beaf0f3 Connect helper C symbols to their static library
This commit adds a `#[link]` annotation to the block defining symbols
coming from a native static library that we build and link. This is
required by rustc to get symbols to get exported correctly when linking
wasmtime into a Rust dynamic library instead of always as an rlib.

While I was at it I went ahead and renamed the symbols now that they're
no longer in C++ and they're doing setjmp/longjmp and not much else.

Closes #3006
2021-06-21 07:27:22 -07:00

14 lines
326 B
Rust

use std::env;
fn main() {
println!("cargo:rerun-if-changed=src/helpers.c");
cc::Build::new()
.warnings(true)
.define(
&format!("CFG_TARGET_OS_{}", env::var("CARGO_CFG_TARGET_OS").unwrap()),
None,
)
.file("src/helpers.c")
.compile("wasmtime-helpers");
}