Skip to content

Commit

Permalink
Merge pull request #1 from SylvainMartel/SylvainMartel-patch-1
Browse files Browse the repository at this point in the history
Sylvain martel patch 1
  • Loading branch information
SylvainMartel authored Apr 20, 2024
2 parents 4b873ae + 017b906 commit 70bf887
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ zmq_has = []
[dependencies]
bitflags = "1.0"
libc = "0.2.15"
zmq-sys = { version = "0.12.0", path = "zmq-sys" }
zmq-sys = { version = "0.12.1", path = "zmq-sys" }

[dev-dependencies]
trybuild = { version = "1" }
Expand Down
1 change: 1 addition & 0 deletions zmq-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ links = "zmq"

[dependencies]
libc = "0.2.15"
libsodium-sys-stable = { version = "1.0", optional = true }

[build-dependencies]
system-deps = "6"
Expand Down
14 changes: 13 additions & 1 deletion zmq-sys/build/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::env;

pub fn configure() {
println!("cargo:rerun-if-changed=build/main.rs");
println!("cargo:rerun-if-env-changed=PROFILE");
Expand All @@ -6,8 +8,18 @@ pub fn configure() {
// 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`.
let maybe_libsodium = if cfg!(feature = "libsodium") {
let lib_dir = env::var("DEP_SODIUM_LIB")
.expect("build metadata `DEP_SODIUM_LIB` required");
let include_dir = env::var("DEP_SODIUM_INCLUDE")
.expect("build metadata `DEP_SODIUM_INCLUDE` required");

Some(zeromq_src::LibLocation::new(lib_dir, include_dir))
} else {
None
};
zeromq_src::Build::new()
.with_libsodium(None)
.with_libsodium(maybe_libsodium)
.build();
}

Expand Down

0 comments on commit 70bf887

Please sign in to comment.