-
-
Notifications
You must be signed in to change notification settings - Fork 217
/
Copy pathbuild.rs
23 lines (18 loc) · 860 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
/*
* Copyright (c) godot-rust; Bromeon and contributors.
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
use std::path::Path;
fn main() {
// It would be better to generate this in /.generated or /target/godot-gen, however IDEs currently
// struggle with static analysis when symbols are outside the crate directory (April 2023).
let gen_path = Path::new(concat!(env!("CARGO_MANIFEST_DIR"), "/src/gen"));
if gen_path.exists() {
std::fs::remove_dir_all(gen_path).unwrap_or_else(|e| panic!("failed to delete dir: {e}"));
}
godot_codegen::generate_core_files(gen_path);
println!("cargo:rerun-if-changed=build.rs");
godot_bindings::emit_godot_version_cfg();
}