Handle builds outside nix

This commit is contained in:
xenia 2024-02-03 12:00:36 +01:00
parent 7b15ea828c
commit 91023adad3

View File

@ -337,7 +337,10 @@ fn format_address_table(m: &HashMap<String, (u32, bool)>) -> String {
}
fn main() {
let version_string = format!("fox32asm {} ({})", env!("NIX_SEMVER"), env!("NIX_GIT_SHA_SHORT"));
let version_string = match (option_env!("NIX_SEMVER"), option_env!("NIX_GIT_SHA_SHORT")) {
(Some(semver), Some(sha)) => format!("fox32asm {semver} ({sha})"),
_ => format!("fox32asm (dev)"),
};
println!("{}", version_string);
let args: Vec<String> = env::args().collect();