scaffold: compile GSettings schema at build time for dev runs

build.rs now runs glib-compile-schemas on data/ so that debug builds
can find the schema without a system-wide install. main.rs sets
GSETTINGS_SCHEMA_DIR from the build-time constant when running in
debug mode.
This commit is contained in:
Jeena 2026-03-20 11:36:12 +00:00
parent 3339bb5ec8
commit 8db0b16954
2 changed files with 13 additions and 1 deletions

View file

@ -2,6 +2,12 @@ mod app;
mod window;
fn main() -> glib::ExitCode {
// In development builds, point GSettings at the locally compiled schema.
// In release/installed builds the schema is found via the system path.
if cfg!(debug_assertions) {
std::env::set_var("GSETTINGS_SCHEMA_DIR", env!("GSETTINGS_SCHEMA_DIR"));
}
let app = app::FeedTheMonkeyApp::new();
app.run()
}