From 77614da6736185a50b71713e4e0b3f7a7c4e840b Mon Sep 17 00:00:00 2001 From: Yuval Adam <_@yuv.al> Date: Mon, 18 Mar 2019 14:16:49 +0200 Subject: Initial version of bchlib-sys --- .gitignore | 3 ++- Cargo.toml | 6 +++++- README.md | 4 ++-- build.rs | 4 +--- src/bch/bch | Bin 22976 -> 0 bytes src/lib.rs | 6 +++++- 6 files changed, 15 insertions(+), 8 deletions(-) delete mode 100644 src/bch/bch diff --git a/.gitignore b/.gitignore index 8b6b607..391c970 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +/src/bch/bch /target **/*.rs.bk @@ -7,4 +8,4 @@ #/target #**/*.rs.bk -Cargo.lock \ No newline at end of file +Cargo.lock diff --git a/Cargo.toml b/Cargo.toml index 7617876..035ef45 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,8 +1,12 @@ [package] -name = "bchlib" +name = "bchlib-sys" version = "0.1.0" authors = ["Yuval Adam <_@yuv.al>"] edition = "2018" +description = "Low-level Rust bindings for BCH encoding/decoding library, based on the bch_codec fork" +license = "GPL-2.0" +license-file = "LICENSE.md" +repository = "https://github.com/yuvadm/bchlib-sys" [build-dependencies] bindgen = "0.42.2" diff --git a/README.md b/README.md index 96e1c81..721e13b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# bchlib +# bchlib-sys -Rust bindings for BCH encoding/decoding library, based on the [bch_codec](https://github.com/mborgerding/bch_codec) fork. +Low-level Rust bindings for BCH encoding/decoding library, based on the [bch_codec](https://github.com/mborgerding/bch_codec) fork. ## Build diff --git a/build.rs b/build.rs index 3ccb76d..605fec2 100644 --- a/build.rs +++ b/build.rs @@ -5,9 +5,7 @@ use std::env; use std::path::PathBuf; fn main() { - cc::Build::new().file("src/bch/bch.c"); - - println!("cargo:rustc-link-lib=bch"); + cc::Build::new().file("src/bch/bch.c").compile("bch"); let bindings = bindgen::Builder::default() .header("src/bch/bch.h") diff --git a/src/bch/bch b/src/bch/bch deleted file mode 100644 index 5b438cd..0000000 Binary files a/src/bch/bch and /dev/null differ diff --git a/src/lib.rs b/src/lib.rs index 4a01ab7..47eaa43 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -6,8 +6,12 @@ include!(concat!(env!("OUT_DIR"), "/bindings.rs")); #[cfg(test)] mod tests { + use super::*; + #[test] fn it_works() { - assert_eq!(2 + 2, 4); + unsafe { + let _c = init_bch(5, 2, 37); + } } } -- cgit v1.3.1