chore(build): add build.rs

This commit is contained in:
xfy
2024-06-27 09:22:41 +08:00
parent 7dcc187a8a
commit e232053cbb
2 changed files with 20 additions and 0 deletions

19
build.rs Normal file
View File

@ -0,0 +1,19 @@
macro_rules! warn {
($($tokens: tt)*) => {
println!("cargo:warning={}", format!($($tokens)*))
}
}
/// Set environment varibles for build.rs
/// set_env!(NAME=xfy);
macro_rules! set_env {
($($tokens: tt)*) => {
println!("cargo:rustc-env={}", format!($($tokens)*))
};
}
fn main() {
set_env!("NAME=xfy");
warn!("hello world");
println!("cargo:info=test");
}