Skip to content

Commit

Permalink
Update build.rs
Browse files Browse the repository at this point in the history
Bench: 1736583
  • Loading branch information
codedeliveryservice committed Apr 16, 2024
1 parent 92e29ee commit 8e8e648
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions build/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ fn main() {
}

fn generate_model_env() {
let path = env::var("EVALFILE").unwrap_or_else(|_| {
let path = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
let path = path.join("networks").join("model.nnue");
std::fs::canonicalize(path).unwrap().to_str().unwrap().to_string()
});
let mut path = env::var("EVALFILE")
.map(PathBuf::from)
.unwrap_or_else(|_| Path::new("networks").join("model.nnue"));

println!("cargo:rustc-env=MODEL={path}");
if path.is_relative() {
path = Path::new(env!("CARGO_MANIFEST_DIR")).join(path);
}

println!("cargo:rustc-env=MODEL={}", path.display());
}

fn generate_attack_maps() {
Expand Down

0 comments on commit 8e8e648

Please sign in to comment.