1 Star 0 Fork 34

普朗克常数/rust_shyper

forked from openEuler/rust_shyper 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
build.rs 1.39 KB
一键复制 编辑 原始数据 按行查看 历史
motse 提交于 2023-10-16 18:49 +08:00 . feat: compiling libfdt in libfdt-binding
// Copyright (c) 2023 Beihang University, Huawei Technologies Co.,Ltd. All rights reserved.
// Rust-Shyper is licensed under Mulan PSL v2.
// You can use this software according to the terms and conditions of the Mulan PSL v2.
// You may obtain a copy of Mulan PSL v2 at:
// http://license.coscl.org.cn/MulanPSL2
// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
// See the Mulan PSL v2 for more details.
use std::process::Command;
use std::env::var;
fn main() {
let arch = var("CARGO_CFG_TARGET_ARCH").unwrap();
let text_start = if cfg!(feature = "tx2") {
if cfg!(feature = "update") {
0x8a000000_u64
} else {
0x83000000_u64
}
} else if cfg!(feature = "pi4") {
0xf0080000_u64
} else if cfg!(feature = "qemu") {
0x40080000_u64
} else {
panic!("Unsupported platform!");
};
println!("cargo:rustc-link-arg=-Tlinkers/{arch}.ld");
println!("cargo:rustc-link-arg=--defsym=TEXT_START={text_start}");
// note: add error checking yourself.
let output = Command::new("date").arg("+\"%Y-%m-%d %H:%M:%S %Z\"").output().unwrap();
let build_time = String::from_utf8(output.stdout).unwrap();
println!("cargo:rustc-env=BUILD_TIME={}", build_time);
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/gueeos-lite/rust_shyper.git
git@gitee.com:gueeos-lite/rust_shyper.git
gueeos-lite
rust_shyper
rust_shyper
master

搜索帮助