From 19940d3e1c6fdb4575867be3651a908b48315931 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Wed, 11 Apr 2018 18:15:00 +0200 Subject: [PATCH] Set version string by hand here if we do not build with cargo --- lib/core/libimagrt/src/version.rs | 17 +++++++++++------ 1 file 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"), } }} }