
use of LLVM 19 by default LLVM version should be much easier to switch from now on a lot of code repetition has been deleted removed llvm-related github action fix format check other small things --------- Co-authored-by: Toka <tokazerkje@outlook.com>
30 lines
792 B
Rust
30 lines
792 B
Rust
// build.rs
|
|
|
|
use std::env;
|
|
|
|
fn main() {
|
|
if cfg!(not(target_os = "linux")) {
|
|
println!("cargo:warning=Not supported!");
|
|
return;
|
|
}
|
|
|
|
let out_dir = env::var_os("OUT_DIR").unwrap();
|
|
let out_dir = out_dir.to_string_lossy().to_string();
|
|
|
|
println!("cargo:rerun-if-changed=src/syscalls.c");
|
|
|
|
// Enforce clang for its -fsanitize-coverage support.
|
|
env::set_var("CC", "clang");
|
|
env::set_var("CXX", "clang++");
|
|
|
|
cc::Build::new().file("src/syscalls.c").compile("syscalls");
|
|
println!("cargo:rerun-if-changed=src/syscalls.c");
|
|
|
|
cc::Build::new().file("src/patch.c").compile("patch");
|
|
println!("cargo:rerun-if-changed=src/patch.c");
|
|
|
|
println!("cargo:rustc-link-search=native={}", &out_dir);
|
|
|
|
println!("cargo:rerun-if-changed=build.rs");
|
|
}
|