-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.rs
27 lines (25 loc) · 1.03 KB
/
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::{env, fs, path::Path};
use const_gen::{const_array_declaration, CompileConstArray};
use encoding_rs::SHIFT_JIS;
fn main() {
let kakutyou = {
let k = SHIFT_JIS.encode("拡張編集\0").0.to_vec();
const_array_declaration!(EXEDIT_NAME = k)
};
let filter_infos = {
let k = SHIFT_JIS.encode("最終フレーム自動調整 - Rust\0").0.to_vec();
let name = const_array_declaration!(FILTER_NAME = k);
let k = SHIFT_JIS
.encode("最終フレーム自動調整 - Rust (v1.0.0)\0")
.0
.to_vec();
let information = const_array_declaration!(FILTER_INFORMATION = k);
[name, information].join("\n")
};
let out_dir = env::var_os("OUT_DIR").unwrap();
let dest_path = Path::new(&out_dir).join("exedit_name.rs");
fs::write(dest_path, kakutyou).unwrap();
let dest_path = Path::new(&out_dir).join("filter_info.rs");
fs::write(dest_path, filter_infos).unwrap();
println!("cargo:rustc-cdylib-link-arg=/DEF:adjust_last_flame.def");
}