summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2018-04-11 18:15:00 +0200
committerMatthias Beyer <mail@beyermatthias.de>2018-04-22 13:38:24 +0200
commit19940d3e1c6fdb4575867be3651a908b48315931 (patch)
tree5a2ca7a5ee8b85f8acd7f28f94e6a6eb008438fe
parenta343a2ab9022044b7239f6ea77b0f468bfa208dc (diff)
Set version string by hand here if we do not build with cargo
-rw-r--r--lib/core/libimagrt/src/version.rs17
1 files changed, 11 insertions, 6 deletions
diff --git a/lib/core/libimagrt/src/version.rs b/lib/core/libimagrt/src/version.rs
index 10e034b7..0a1a6217 100644
--- a/lib/core/libimagrt/src/version.rs
+++ b/lib/core/libimagrt/src/version.rs
@@ -20,13 +20,18 @@
#[macro_export]
macro_rules! make_imag_version {
() => {{
- let pkg_version = env!("CARGO_PKG_VERSION");
- let git_version = env!("CARGO_BUILD_VERSION");
+ let pkg_version = option_env!("CARGO_PKG_VERSION");
+ let git_version = option_env!("CARGO_BUILD_VERSION");
- if git_version == "" {
- String::from(pkg_version)
- } else {
- String::from(git_version)
+ match (git_version, pkg_version) {
+ (Some(git_version), Some(pkg_version)) => if git_version == "" {
+ String::from(pkg_version)
+ } else {
+ String::from(git_version)
+ },
+
+ // imag is not beeing build with cargo... we have to set it by hand here.
+ _ => String::from("0.8.0"),
}
}}
}