mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-10 07:04:29 +00:00
Forward CMake configs to Cargo
This commit is contained in:
parent
5db08e1126
commit
e4df340f43
2 changed files with 13 additions and 0 deletions
|
@ -67,6 +67,10 @@ corrosion_set_env_vars(${fish_rust_target}
|
|||
"PREFIX=${CMAKE_INSTALL_PREFIX}"
|
||||
# Temporary hack to propogate CMake flags/options to build.rs.
|
||||
"CMAKE_WITH_GETTEXT=${CMAKE_WITH_GETTEXT}"
|
||||
"DOCDIR=${DOCDIR}"
|
||||
"DATADIR=${DATADIR}"
|
||||
"SYSCONFDIR=${SYSCONFDIR}"
|
||||
"BINDIR=${BINDIR}"
|
||||
)
|
||||
|
||||
# this needs an extra fish-rust due to the poor source placement
|
||||
|
|
|
@ -1,7 +1,15 @@
|
|||
use rsconf::{LinkType, Target};
|
||||
use std::env;
|
||||
use std::error::Error;
|
||||
|
||||
fn main() {
|
||||
for key in ["DOCDIR", "DATADIR", "SYSCONFDIR", "BINDIR"] {
|
||||
if let Ok(val) = env::var(key) {
|
||||
// Forward some CMake config
|
||||
println!("cargo:rustc-env={key}={val}");
|
||||
}
|
||||
}
|
||||
|
||||
cc::Build::new()
|
||||
.file("fish-rust/src/compat.c")
|
||||
.compile("libcompat.a");
|
||||
|
@ -17,6 +25,7 @@ fn main() {
|
|||
// If FISH_BUILD_DIR is given by CMake, then use it; otherwise assume it's at build.
|
||||
let fish_build_dir =
|
||||
std::env::var("FISH_BUILD_DIR").unwrap_or(format!("{}/{}", rust_dir, "build/"));
|
||||
println!("cargo:rustc-env=FISH_BUILD_DIR={}", fish_build_dir);
|
||||
|
||||
// Where autocxx should put its stuff.
|
||||
let autocxx_gen_dir = std::env::var("FISH_AUTOCXX_GEN_DIR")
|
||||
|
|
Loading…
Reference in a new issue