Adding build.rs for config file copy and changing render backend to tiny-skia.
This commit is contained in:
@@ -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");
|
||||
}
|
||||
Reference in New Issue
Block a user