-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.rs
27 lines (23 loc) · 945 Bytes
/
build.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use std::fs;
use std::path::Path;
use std::env;
fn main() {
#[cfg(target_os = "windows")]
{
let res = winres::WindowsResource::new();
res.compile().unwrap();
}
println!("cargo:rerun-if-changed=./config/sidid.cfg");
println!("cargo:rerun-if-changed=./config/tedid.cfg");
println!("cargo:rerun-if-changed=./config/sidid.nfo");
copy_config_to_build_folder();
}
fn copy_config_to_build_folder() {
let out_dir = env::var("OUT_DIR").unwrap();
let build_folder_root = Path::new(&out_dir).parent().unwrap().parent().unwrap().parent().unwrap();
if build_folder_root.exists() {
let _ = fs::copy("./config/sidid.cfg", build_folder_root.join("sidid.cfg").to_str().unwrap());
let _ = fs::copy("./config/tedid.cfg", build_folder_root.join("tedid.cfg").to_str().unwrap());
let _ = fs::copy("./config/sidid.nfo", build_folder_root.join("sidid.nfo").to_str().unwrap());
}
}