mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +00:00
Turns out the build time only seems to capture the last time you managed to force a full rebuild (???). Even though cargo indicates that a rebuild had happened of the main.rs, the environment variable containing the time is not being updated, because the build.rs file isn't being run. But! if you force a trigger of that file, then cargo decides to rebuild *everything* which greatly increases the build time, which is a drag for development. So, just remove the build time notice. If it's not going to be correct, better to not emit it than to be outright misleading...
24 lines
872 B
Rust
24 lines
872 B
Rust
// NOTE: Adapted from cortex-m/build.rs
|
|
use std::env;
|
|
|
|
extern crate vergen;
|
|
use vergen::{ConstantsFlags, generate_cargo_keys};
|
|
|
|
fn main() {
|
|
let target = env::var("TARGET").unwrap();
|
|
|
|
let target_os = target.split('-').nth(2).unwrap_or("none");
|
|
|
|
// If we're not running on a desktop-class operating system, emit the "baremetal"
|
|
// config setting. This will enable software to do tasks such as
|
|
// managing memory.
|
|
if target_os == "none" {
|
|
println!("cargo:rustc-cfg=baremetal");
|
|
}
|
|
|
|
generate_cargo_keys(ConstantsFlags::SHA /*| ConstantsFlags::BUILD_TIMESTAMP*/).unwrap();
|
|
// BUILD_TIMESTAMP doesn't work -- it doesn't update because of the below line
|
|
// removing the below line causes a lengthy full-rebuild just to capture a timestamp.
|
|
// so, we're removing the timestamp.
|
|
println!("cargo:rerun-if-changed=build.rs");
|
|
}
|