mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-29 18:51:15 -03:00
Fix path env on cygwin when cross compiling from Windows
This commit is contained in:
committed by
Johannes Altmanninger
parent
2e89f37446
commit
4eceabeaad
16
Cargo.lock
generated
16
Cargo.lock
generated
@@ -117,6 +117,7 @@ dependencies = [
|
|||||||
"rust-embed",
|
"rust-embed",
|
||||||
"serial_test",
|
"serial_test",
|
||||||
"terminfo",
|
"terminfo",
|
||||||
|
"unix_path",
|
||||||
"widestring",
|
"widestring",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -545,6 +546,21 @@ version = "1.0.14"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83"
|
checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "unix_path"
|
||||||
|
version = "1.0.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "af8e291873ae77c4c8d9c9b34d0bee68a35b048fb39c263a5155e0e353783eaf"
|
||||||
|
dependencies = [
|
||||||
|
"unix_str",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "unix_str"
|
||||||
|
version = "1.0.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2ace0b4755d0a2959962769239d56267f8a024fef2d9b32666b3dcd0946b0906"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "version_check"
|
name = "version_check"
|
||||||
version = "0.9.5"
|
version = "0.9.5"
|
||||||
|
|||||||
@@ -71,6 +71,9 @@ serial_test = { version = "3", default-features = false }
|
|||||||
cc = "1.0.94"
|
cc = "1.0.94"
|
||||||
rsconf = "0.2.2"
|
rsconf = "0.2.2"
|
||||||
|
|
||||||
|
[target.'cfg(windows)'.build-dependencies]
|
||||||
|
unix_path = "1.0.1"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
crate-type = ["rlib"]
|
crate-type = ["rlib"]
|
||||||
path = "src/lib.rs"
|
path = "src/lib.rs"
|
||||||
|
|||||||
7
build.rs
7
build.rs
@@ -3,7 +3,7 @@
|
|||||||
use rsconf::{LinkType, Target};
|
use rsconf::{LinkType, Target};
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::Path;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
setup_paths();
|
setup_paths();
|
||||||
@@ -232,6 +232,11 @@ fn has_small_stack(_: &Target) -> Result<bool, Box<dyn Error>> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn setup_paths() {
|
fn setup_paths() {
|
||||||
|
#[cfg(unix)]
|
||||||
|
use std::path::PathBuf;
|
||||||
|
#[cfg(windows)]
|
||||||
|
use unix_path::{Path, PathBuf};
|
||||||
|
|
||||||
fn get_path(name: &str, default: &str, onvar: &Path) -> PathBuf {
|
fn get_path(name: &str, default: &str, onvar: &Path) -> PathBuf {
|
||||||
let mut var = PathBuf::from(env::var(name).unwrap_or(default.to_string()));
|
let mut var = PathBuf::from(env::var(name).unwrap_or(default.to_string()));
|
||||||
if var.is_relative() {
|
if var.is_relative() {
|
||||||
|
|||||||
Reference in New Issue
Block a user