mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
use codegen, instead of build.rs, to build header file
This commit is contained in:
parent
02055b122e
commit
b1d537ac87
8 changed files with 76 additions and 35 deletions
|
@ -2,7 +2,6 @@
|
|||
name = "taskchampion-lib"
|
||||
version = "0.1.0"
|
||||
edition = "2018"
|
||||
build = "build.rs"
|
||||
|
||||
[lib]
|
||||
name = "taskchampion"
|
||||
|
@ -17,6 +16,3 @@ anyhow = "1.0"
|
|||
|
||||
[dev-dependencies]
|
||||
pretty_assertions = "1"
|
||||
|
||||
[build-dependencies]
|
||||
cbindgen = "0.20.0"
|
||||
|
|
26
lib/build.rs
26
lib/build.rs
|
@ -1,26 +0,0 @@
|
|||
use cbindgen::*;
|
||||
|
||||
use std::env;
|
||||
|
||||
fn main() {
|
||||
let crate_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
|
||||
|
||||
Builder::new()
|
||||
.with_crate(crate_dir)
|
||||
.with_config(Config {
|
||||
language: Language::C,
|
||||
cpp_compat: true,
|
||||
sys_includes: vec!["stdbool.h".into(), "stdint.h".into(), "time.h".into()],
|
||||
usize_is_size_t: true,
|
||||
no_includes: true,
|
||||
enumeration: EnumConfig {
|
||||
// this appears to still default to true for C
|
||||
enum_class: false,
|
||||
..Default::default()
|
||||
},
|
||||
..Default::default()
|
||||
})
|
||||
.generate()
|
||||
.expect("Unable to generate bindings")
|
||||
.write_to_file("taskchampion.h");
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue