Skip to content

Commit

Permalink
update sys.rs to 6.1.0 rc4 (tokio-rs#157)
Browse files Browse the repository at this point in the history
* Use BUILD_IO_URING_INCLUDE_FILE for build

* Update sys to 6.1.0 rc4
  • Loading branch information
quininer authored Dec 17, 2022
1 parent c719893 commit 4089ede
Show file tree
Hide file tree
Showing 4 changed files with 1,759 additions and 2,164 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
**/target
**/*.rs.bk
Cargo.lock
include-file.h
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ libc = { version = "0.2.98", default-features = false }
sc = { version = "0.2", optional = true }

[build-dependencies]
bindgen = { version = "0.60", optional = true }
bindgen = { version = "0.61", optional = true }

[dev-dependencies]
anyhow = "1"
Expand Down
14 changes: 12 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,18 @@ fn main() {
#[cfg(feature = "overwrite")]
let outdir = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap()).join("src/sys");

bindgen::Builder::default()
.header_contents("include-file.h", INCLUDE)
let mut builder = bindgen::Builder::default();

if let Some(path) = env::var("BUILD_IO_URING_INCLUDE_FILE")
.ok()
.filter(|path| !path.is_empty())
{
builder = builder.header(path);
} else {
builder = builder.header_contents("include-file.h", INCLUDE);
}

builder
.ctypes_prefix("libc")
.prepend_enum_name(false)
.derive_default(true)
Expand Down
Loading

0 comments on commit 4089ede

Please sign in to comment.