mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-01 04:41:14 -03:00
Port UVAR_FILE_SET_MTIME_HACK
Notably this exposes config.h to Rust (for UVAR_FILE_SET_MTIME_HACK). In future we should move the CMake checks into build.rs so we can potentially get rid of CMake.
This commit is contained in:
@@ -12,6 +12,11 @@ fn main() {
|
|||||||
|
|
||||||
cc::Build::new()
|
cc::Build::new()
|
||||||
.file("fish-rust/src/compat.c")
|
.file("fish-rust/src/compat.c")
|
||||||
|
.include(
|
||||||
|
&std::env::var("FISH_BUILD_DIR")
|
||||||
|
// Add our default to potentially help tools that don't go through CMake.
|
||||||
|
.unwrap_or("./build".into()),
|
||||||
|
)
|
||||||
.compile("libcompat.a");
|
.compile("libcompat.a");
|
||||||
|
|
||||||
let rust_dir = env!("CARGO_MANIFEST_DIR");
|
let rust_dir = env!("CARGO_MANIFEST_DIR");
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
#include "config.h"
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <term.h>
|
#include <term.h>
|
||||||
@@ -47,3 +50,12 @@ uint64_t C_MNT_LOCAL() {
|
|||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const bool uvar_file_set_mtime_hack =
|
||||||
|
#ifdef UVAR_FILE_SET_MTIME_HACK
|
||||||
|
true;
|
||||||
|
#else
|
||||||
|
false;
|
||||||
|
#endif
|
||||||
|
#undef UVAR_FILE_SET_MTIME_HACK
|
||||||
|
bool UVAR_FILE_SET_MTIME_HACK() { return uvar_file_set_mtime_hack; }
|
||||||
|
|||||||
Reference in New Issue
Block a user