Remove the ffi-headers feature

Rely on a separate cbindgen instance instead, which is less self-contained but more practical.
This commit is contained in:
Oliver Hamlet
2024-04-30 23:29:31 +01:00
parent adeac2317c
commit c508533d4b
5 changed files with 14 additions and 191 deletions
-8
View File
@@ -3,7 +3,6 @@ name = "loot-condition-interpreter-ffi"
version = "3.1.0"
authors = ["Oliver Hamlet <oliver@ortham.io>"]
license = "MIT"
build = "build.rs"
edition = "2018"
[dependencies]
@@ -13,10 +12,3 @@ libc = "0.2"
[lib]
name = "loot_condition_interpreter_ffi"
crate-type = ["staticlib"]
[features]
default = []
ffi-headers = ["cbindgen"]
[build-dependencies]
cbindgen = { version = "0.26", optional = true }
-25
View File
@@ -1,25 +0,0 @@
#[cfg(feature = "ffi-headers")]
mod ffi_headers {
extern crate cbindgen;
use std::env;
use std::fs;
use self::cbindgen::generate;
pub fn generate_headers() {
let crate_dir = env::var("CARGO_MANIFEST_DIR")
.expect("could not get value of CARGO_MANIFEST_DIR env var");
fs::create_dir_all("include").expect("could not create include directory");
generate(&crate_dir)
.expect("could not generate C/C++ header file")
.write_to_file("include/loot_condition_interpreter.h");
}
}
fn main() {
#[cfg(feature = "ffi-headers")]
ffi_headers::generate_headers();
}