Skip to content

Commit

Permalink
build: dirty hack to solve dylib C linking issue
Browse files Browse the repository at this point in the history
Related issue: rust-lang/rust#64340
  • Loading branch information
Alex Kornitzer committed Jan 30, 2020
1 parent 08e47c8 commit 388e1eb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "nng-sys"
version = "1.1.1-rc.1"
version = "1.1.1-rc.2"
authors = ["Nathan Kent <[email protected]>", "Jake W <[email protected]>"]

description = "Bindings to NNG (Nanomsg-Next-Generation) aka Nanomsg2"
Expand Down Expand Up @@ -46,7 +46,7 @@ cty = {version = "0.2", optional = true}

[build-dependencies]
cmake = {version = "0.1", optional = true}
bindgen = {version = "0.47", optional = true}
bindgen = {version = "0.52", optional = true}

[package.metadata.docs.rs]
all-features = false
7 changes: 5 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ fn link_nng() {
dst.join("lib64").display()
);

println!("cargo:rustc-link-lib=static=nng");
//println!("cargo:rustc-link-lib=static=nng");
println!("cargo:rustc-link-lib=nng");
}

#[cfg(not(feature = "build-nng"))]
Expand All @@ -87,7 +88,9 @@ fn build_bindgen() {
// Generate `pub const NNG_UNIT_EVENTS` instead of `nng_unit_enum_NNG_UNIT_EVENTS`
.prepend_enum_name(false)
// Generate `pub enum ...` instead of multiple `pub const ...`
.default_enum_style(bindgen::EnumVariation::Rust)
.default_enum_style(bindgen::EnumVariation::Rust {
non_exhaustive: false,
})
.constified_enum("nng_flag_enum")
// NNG_ESYSERR and NNG_ETRANERR are used like flag
.constified_enum("nng_errno_enum")
Expand Down

0 comments on commit 388e1eb

Please sign in to comment.