mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-23 17:33:23 +00:00
Implement should_panic for ktest and clear the codebase
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
bb0560530f
commit
45a6b2f46c
21
build.rs
21
build.rs
@ -1,16 +1,19 @@
|
||||
use std::{error::Error, path::PathBuf};
|
||||
|
||||
fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||
let linker_script_path = PathBuf::from(std::env::var("CARGO_MANIFEST_DIR").unwrap())
|
||||
.join("framework")
|
||||
.join("jinux-frame")
|
||||
.join("src")
|
||||
.join("arch")
|
||||
.join("x86")
|
||||
.join("boot")
|
||||
.join("linker.ld");
|
||||
let target = std::env::var("CARGO_CFG_TARGET_ARCH").unwrap();
|
||||
let linker_script_path = if target == "x86_64" {
|
||||
PathBuf::from(std::env::var("CARGO_MANIFEST_DIR").unwrap())
|
||||
.join("framework")
|
||||
.join("jinux-frame")
|
||||
.join("src")
|
||||
.join("arch")
|
||||
.join("x86")
|
||||
.join("linker.ld")
|
||||
} else {
|
||||
panic!("Unsupported target arch: {}", target);
|
||||
};
|
||||
println!("cargo:rerun-if-changed={}", linker_script_path.display());
|
||||
println!("cargo:rustc-link-arg=-T{}", linker_script_path.display());
|
||||
println!("cargo:rerun-if-env-changed=CARGO_PKG_NAME");
|
||||
Ok(())
|
||||
}
|
||||
|
Reference in New Issue
Block a user