Skip to content

Commit b8bbaf6

Browse files
committed
Move build config to its own file
1 parent de3306e commit b8bbaf6

6 files changed

Lines changed: 14 additions & 82 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/target
22
/result
33
_build/
4+
src/build_config.rs
45
subprojects/blueprint-compiler

src/build_config.rs.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
pub const APP_ID: &str = @APP_ID@;
2+
pub const GETTEXT_PACKAGE: &str = @GETTEXT_PACKAGE@;
3+
pub const LOCALEDIR: &str = @LOCALEDIR@;
4+
pub const PKGDATADIR: &str = @PKGDATADIR@;
5+
pub const PROFILE: &str = @PROFILE@;
6+
pub const RESOURCES_FILE: &str = concat!(@PKGDATADIR@, "/resources.gresource");
7+
pub const VERSION: &str = @VERSION@;

src/config.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
pub const APP_ID: &str = "com.ranfdev.Geopard";
2-
pub const GETTEXT_PACKAGE: &str = "geopard";
3-
pub const LOCALEDIR: &str = "/app/share/locale";
4-
pub const PKGDATADIR: &str = "/app/share/geopard";
5-
pub const PROFILE: &str = "";
6-
pub const RESOURCES_FILE: &str = concat!("/app/share/geopard", "/resources.gresource");
7-
pub const VERSION: &str = "1.0.0";
1+
pub use crate::build_config::*;
82

93
use once_cell::sync::Lazy;
104
use serde::{Deserialize, Serialize};

src/config.rs.in

Lines changed: 0 additions & 71 deletions
This file was deleted.

src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use std::rc::Rc;
1111

1212
mod common;
1313
mod config;
14+
mod build_config;
1415
mod draw_ctx;
1516
mod gemini;
1617
mod macros;

src/meson.build

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ global_conf.set_quoted('VERSION', version + version_suffix)
66
global_conf.set_quoted('GETTEXT_PACKAGE', gettext_package)
77
global_conf.set_quoted('LOCALEDIR', localedir)
88
config = configure_file(
9-
input: 'config.rs.in',
10-
output: 'config.rs',
9+
input: 'build_config.rs.in',
10+
output: 'build_config.rs',
1111
configuration: global_conf
1212
)
1313
# Copy the config.rs output to the source directory.
1414
run_command(
1515
'cp',
16-
meson.project_build_root() / 'src' / 'config.rs',
17-
meson.project_source_root() / 'src' / 'config.rs',
16+
meson.project_build_root() / 'src' / 'build_config.rs',
17+
meson.project_source_root() / 'src' / 'build_config.rs',
1818
check: true
1919
)
2020

0 commit comments

Comments
 (0)