Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for pgm and epgm #396

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ default = ["zmq_has"]
# this feature is a no-op and only present for backward-compatibility;
# it will be removed in the next API-breaking release.
zmq_has = []
libpgm = ["zmq-sys/libpgm"]

[dependencies]
bitflags = "1.0"
Expand Down
1 change: 1 addition & 0 deletions zmq-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ build = "build/main.rs"
links = "zmq"

[features]
libpgm = []

[dependencies]
libc = "0.2.15"
Expand Down
14 changes: 14 additions & 0 deletions zmq-sys/build/main.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
use std::env;

pub fn configure() {
println!("cargo:rerun-if-changed=build/main.rs");
println!("cargo:rerun-if-env-changed=PROFILE");

let maybe_libpgm = if cfg!(feature = "libpgm") {
let lib_dir = env::var("DEP_PGM_LIB")
.expect("build metadata `DEP_PGM_LIB` required");
let include_dir = env::var("DEP_PGM_INCLUDE")
.expect("build metadata `DEP_PGM_INCLUDE` required");

Some(zeromq_src::LibLocation::new(lib_dir, include_dir))
} else {
None
};

// Note that by default `libzmq` builds without `libsodium` by instead
// relying on `tweetnacl`. However since this `tweetnacl` [has never been
// audited nor is ready for production](https://github.com/zeromq/libzmq/issues/3006),
// we link against `libsodium` to enable `ZMQ_CURVE`.
zeromq_src::Build::new()
.with_libsodium(None)
.with_libpgm(maybe_libpgm)
.build();
}

Expand Down