mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 13:39:02 +00:00
Don't use a hardcoded ./build/ path for FISH_BUILD_DIR
We use this fallback value for FISH_BUILD_DIR when `cargo` is not invoked from `cmake`, but we already have a cargo-defined build directory and we shouldn't just decide to use $TARGET_MANIFEST_DIR/build instead. Tests pass locally!
This commit is contained in:
parent
5f8f799cf7
commit
2d4e42ee93
1 changed files with 5 additions and 2 deletions
7
build.rs
7
build.rs
|
@ -10,8 +10,11 @@ fn main() {
|
|||
|
||||
// Add our default to enable tools that don't go through CMake, like "cargo test" and the
|
||||
// language server.
|
||||
let build_dir = format!("{}/build", env!("CARGO_MANIFEST_DIR"));
|
||||
let build_dir = option_env!("FISH_BUILD_DIR").unwrap_or(&build_dir);
|
||||
|
||||
// FISH_BUILD_DIR is set by CMake, if we are using it.
|
||||
// OUT_DIR is set by Cargo when the build script is running (not compiling)
|
||||
let default_build_dir = env::var("OUT_DIR").unwrap();
|
||||
let build_dir = option_env!("FISH_BUILD_DIR").unwrap_or(&default_build_dir);
|
||||
rsconf::set_env_value("FISH_BUILD_DIR", build_dir);
|
||||
// We need to canonicalize (i.e. realpath)
|
||||
// the manifest dir because we want to compare it simply as a string at runtime.
|
||||
|
|
Loading…
Reference in a new issue