Skip to content

Commit

Permalink
check arch
Browse files Browse the repository at this point in the history
  • Loading branch information
quininer committed Aug 17, 2024
1 parent ff0f693 commit e4f1dcc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#[cfg(not(feature = "bindgen"))]
fn main() {}
fn main() {
println!("cargo::rustc-check-cfg=cfg(io_uring_skip_arch_check)");
}

#[cfg(feature = "bindgen")]
fn main() {
Expand Down
9 changes: 9 additions & 0 deletions src/sys/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ fn to_result(ret: c_int) -> io::Result<c_int> {
}
}

#[cfg(all(
not(feature = "bindgen"),
not(target_arch = "x86_64"),
not(io_uring_skip_arch_check)
))]
compile_error!("The prebuilt `sys.rs` may not be compatible with your target,
please use bindgen feature to generate new `sys.rs` of your arch
or use `--cfg=io_uring_skip_arch_check` to skip the check.");

#[cfg(all(feature = "bindgen", not(feature = "overwrite")))]
include!(concat!(env!("OUT_DIR"), "/sys.rs"));

Expand Down

0 comments on commit e4f1dcc

Please sign in to comment.