Skip to content

Commit

Permalink
Fix relative paths
Browse files Browse the repository at this point in the history
Bench: 1736583
  • Loading branch information
codedeliveryservice committed Apr 16, 2024
1 parent 4c8d6d5 commit 335d014
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions build/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@ use std::{
env,
fs::File,
io::{BufWriter, Write},
path::Path,
path::{Path, PathBuf},
};

mod attacks;
mod magics;
mod maps;

fn main() {
let model = env::var("EVALFILE").unwrap_or(String::from("../networks/model.nnue"));
println!("cargo:rustc-env=MODEL={model}");
let path = env::var("EVALFILE").unwrap_or_else(|_| {
let path = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
let path = path.join("networks").join("model.nnue");
path.to_str().unwrap().to_string()
});

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

let dir = env::var("OUT_DIR").unwrap();
let path = Path::new(&dir).join("lookup.rs");
Expand Down

0 comments on commit 335d014

Please sign in to comment.