don't genrate code in src/

[Outputs of Build Script](https://doc.rust-lang.org/cargo/reference/build-scripts.html#outputs-of-the-build-script) states that only files in $OUT_DIR may be modified
This commit is contained in:
Skgland
2022-01-10 19:59:21 +01:00
parent bcacb49c05
commit a5de329712
5 changed files with 43 additions and 21 deletions

View File

@@ -56,7 +56,7 @@ fn main() {
find_prolog_files(&mut libraries, "", &lib_path);
libraries.write_all(b"\n m\n };\n}\n").unwrap();
let instructions_path = Path::new("src/instructions.rs");
let instructions_path = Path::new(&out_dir).join("instructions.rs");
let mut instructions_file = File::create(&instructions_path).unwrap();
let quoted_output = generate_instructions_rs();
@@ -70,10 +70,10 @@ fn main() {
.spawn().unwrap()
.wait().unwrap();
let static_atoms_path = Path::new("src/static_atoms.rs");
let static_atoms_path = Path::new(&out_dir).join("static_atoms.rs");
let mut static_atoms_file = File::create(&static_atoms_path).unwrap();
let quoted_output = index_static_strings();
let quoted_output = index_static_strings(&instructions_path);
static_atoms_file
.write_all(quoted_output.to_string().as_bytes())