From d61bd044a41aee9dacafcae8d6c8ef6b8598dacb Mon Sep 17 00:00:00 2001 From: groche97 Date: Tue, 23 May 2023 20:40:54 +0200 Subject: [PATCH] Prepare for releases --- Cargo.toml | 5 ++++- src/conf/mod.rs | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 98c83c2..2a22bc1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,4 +5,7 @@ edition = "2021" [dependencies] serde = { version = "*", features = ["derive"] } -serde_yaml = "*" \ No newline at end of file +serde_yaml = "*" + +[profile.release] +lto = true \ No newline at end of file diff --git a/src/conf/mod.rs b/src/conf/mod.rs index 3076e47..7ae1c4f 100644 --- a/src/conf/mod.rs +++ b/src/conf/mod.rs @@ -3,9 +3,18 @@ use std::fs::File; use std::str::FromStr; use std::io::prelude::*; use std::collections::HashMap; +#[cfg(not(debug_assertions))] +macro_rules! PATH { () => { "/etc/mrproxy/" } } +#[cfg(not(debug_assertions))] +static FILE_CONF: &str = concat!(PATH!(),"mrprox.conf"); +#[cfg(not(debug_assertions))] +static FILE_SERVERS: &str = concat!(PATH!(),"mrprox_servers.conf"); +#[cfg(debug_assertions)] static FILE_CONF: &str = "mrprox.conf"; +#[cfg(debug_assertions)] static FILE_SERVERS: &str = "mrprox_servers.conf"; + const DEF_PORT: u16 = 25565; #[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]