Adding build.rs for config file copy and changing render backend to tiny-skia.

This commit is contained in:
2026-05-26 18:26:56 +02:00
parent 6b4550dc8e
commit 078589332c
3 changed files with 46 additions and 696 deletions
+23
View File
@@ -0,0 +1,23 @@
use std::env;
use std::fs;
use std::path::PathBuf;
fn main() {
let profile = env::var("PROFILE").unwrap();
let manifest_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
let target_dir = PathBuf::from(&manifest_dir).join("target").join(&profile);
// Ensure target directory exists
if !target_dir.exists() {
fs::create_dir_all(&target_dir).ok();
}
// Copy the file (e.g., config.json) to the target directory
let source = PathBuf::from(&manifest_dir).join("src").join("kira_config.toml");
let dest = target_dir.join("kira_config.toml");
fs::copy(&source, &dest).expect("Failed to copy kira_config.toml");
// Optional: Tell Cargo to re-run this script if the source file changes
println!("cargo:rerun-if-changed=src/kira_config.toml");
}