Skip to content

Commit 66c98a0

Browse files
authored
Replace cqdb C binding with Rust implementation (#19)
1 parent ebcbd3a commit 66c98a0

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

crfsuite-sys/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ edition = "2018"
1414
[dependencies]
1515
libc = "0.2"
1616
liblbfgs-sys = "0.1.0"
17-
cqdb-sys = "0.1.0"
17+
libcqdb = "0.1.0"
1818

1919
[build-dependencies]
2020
cc = "1.0"

crfsuite-sys/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ fn fail_on_empty_directory(name: &str) {
1313

1414
fn build_crfsuite() {
1515
let mut cfg = cmake::Config::new("");
16-
cfg.register_dep("cqdb").register_dep("lbfgs");
16+
cfg.register_dep("libcqdb").register_dep("lbfgs");
1717
if cfg!(target_os = "macos") {
1818
let target_arch = std::env::var("CARGO_CFG_TARGET_ARCH").unwrap();
1919
if target_arch == "x86_64" {
@@ -22,7 +22,7 @@ fn build_crfsuite() {
2222
}
2323
let dst = cfg.build();
2424
println!("cargo:rustc-link-search=native={}/lib", dst.display());
25-
println!("cargo:rustc-link-lib=static=cqdb");
25+
// println!("cargo:rustc-link-lib=static=libcqdb");
2626
println!("cargo:rustc-link-lib=static=lbfgs");
2727
println!("cargo:rustc-link-lib=static=crfsuite");
2828
println!("cargo:root={}", dst.to_str().unwrap());

crfsuite-sys/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
#![allow(non_snake_case)]
33
#![allow(non_upper_case_globals)]
44

5+
/// Force linking with libcqdb
6+
#[doc(hidden)]
7+
pub use libcqdb::*;
8+
59
mod bindings;
610

711
pub use self::bindings::*;

0 commit comments

Comments
 (0)