Skip to content

Commit

Permalink
..
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfv committed Oct 16, 2024
1 parent fea49e3 commit 083832e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
2 changes: 0 additions & 2 deletions src/script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,6 @@ const CMDEXE_PREAMBLE: &str = r#"
@echo on
IF "%CONDA_BUILD%" == "" (
@rem special behavior from conda-build for Windows
set "INCLUDE=((LIBRARY_INC));%INCLUDE%"
set "LIB=((LIBRARY_LIB));%LIB%"
call ((script_path))
)
@rem re-enable echo because the activation scripts might have messed with it
Expand Down
26 changes: 21 additions & 5 deletions src/windows/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,39 @@ pub fn default_env_vars(
let mut vars = HashMap::<String, Option<String>>::new();
vars.insert(
"SCRIPTS".to_string(),
Some(prefix.join("Scripts").to_string_lossy().to_string()),
Some(prefix.join("Scripts").display().to_string()),
);
vars.insert(
"LIBRARY_PREFIX".to_string(),
Some(library_prefix.to_string_lossy().to_string()),
Some(library_prefix.display().to_string()),
);
vars.insert(
"LIBRARY_BIN".to_string(),
Some(library_prefix.join("bin").to_string_lossy().to_string()),
Some(library_prefix.join("bin").display().to_string()),
);
let library_lib = library_prefix.join("lib");
let library_inc = library_prefix.join("include");
vars.insert(
"LIBRARY_INC".to_string(),
Some(library_prefix.join("include").to_string_lossy().to_string()),
Some(library_inc.display().to_string()),
);
vars.insert(
"LIBRARY_LIB".to_string(),
Some(library_prefix.join("lib").to_string_lossy().to_string()),
Some(library_lib.display().to_string()),
);

// This adds the LIB and INCLUDE vars. It would not be entirely correct if someone
// overwrites the LIBRARY_LIB or LIBRARY_INCLUDE variables from the variants.yaml
// but I think for now this is fine.
let lib_var = std::env::var("LIB").ok().unwrap_or_default();
let include_var = std::env::var("INCLUDE").ok().unwrap_or_default();
vars.insert(
"LIB".to_string(),
Some(format!("{};{}", library_lib.display(), lib_var)),
);
vars.insert(
"INCLUDE".to_string(),
Some(format!("{};{}", library_inc.display(), include_var)),
);

let default_vars = vec![
Expand Down

0 comments on commit 083832e

Please sign in to comment.