using cargo.toml version (#1813)
- Replaced `CFG_RELEASE` with `CARGO_PKG_VERSION` - No rerun on `CFG_RELEASE`
This commit is contained in:
1 parent
663296ae45
commit
8be9a7192b
2 files changed
+1
-6
No files matched your search
@@ -5,14 +5,9 @@ use std::{env, path::PathBuf, process::Command};
|
|||||||
fn main() {
|
fn main() {
|
||||||
set_rerun();
|
set_rerun();
|
||||||
set_commit_info();
|
set_commit_info();
|
||||||
if option_env!("CFG_RELEASE").is_none() {
|
|
||||||
println!("cargo:rustc-env=POKE_RA_DEVS=1");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_rerun() {
|
fn set_rerun() {
|
||||||
println!("cargo:rerun-if-env-changed=CFG_RELEASE");
|
|
||||||
|
|
||||||
let mut manifest_dir = PathBuf::from(
|
let mut manifest_dir = PathBuf::from(
|
||||||
env::var("CARGO_MANIFEST_DIR").expect("`CARGO_MANIFEST_DIR` is always set by cargo."),
|
env::var("CARGO_MANIFEST_DIR").expect("`CARGO_MANIFEST_DIR` is always set by cargo."),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ impl fmt::Display for VersionInfo {
|
|||||||
|
|
||||||
/// Returns information about cargo's version.
|
/// Returns information about cargo's version.
|
||||||
pub const fn version() -> VersionInfo {
|
pub const fn version() -> VersionInfo {
|
||||||
let version = match option_env!("CFG_RELEASE") {
|
let version = match option_env!("CARGO_PKG_VERSION") {
|
||||||
Some(x) => x,
|
Some(x) => x,
|
||||||
None => "0.0.0",
|
None => "0.0.0",
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in new issue
Block a user