Move compile-time build info to aiken-project

So that we can use it as part of the blueprints.
This commit is contained in:
KtorZ
2023-10-06 14:08:47 +02:00
parent bd61a2ddf3
commit d56d5180cf
8 changed files with 40 additions and 48 deletions

View File

@@ -116,3 +116,19 @@ impl Config {
Some(self)
}
}
mod built_info {
include!(concat!(env!("OUT_DIR"), "/built.rs"));
}
pub fn compiler_version(include_commit_hash: bool) -> String {
if include_commit_hash {
format!(
"v{} {}",
built_info::PKG_VERSION_MAJOR,
built_info::GIT_COMMIT_HASH_SHORT.unwrap_or("unknown")
)
} else {
format!("v{}", built_info::PKG_VERSION_MAJOR,)
}
}