Skip to content
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)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tclarke This needs to be defined still, right?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is not available yet since it's require this pull request to be merged.

.build();
}

Expand Down