Commit 05ab9a84 authored by Frank's avatar Frank

find libsodium with cmake

parent 2cdfa1ff
...@@ -29,6 +29,8 @@ if(WITH_TWEETNACL) ...@@ -29,6 +29,8 @@ if(WITH_TWEETNACL)
else() else()
list(APPEND TWEETNACL_SOURCES tweetnacl/contrib/randombytes/devurandom.c) list(APPEND TWEETNACL_SOURCES tweetnacl/contrib/randombytes/devurandom.c)
endif() endif()
else()
find_library(SODIUM_FOUND sodium)
endif() endif()
...@@ -610,7 +612,7 @@ else() ...@@ -610,7 +612,7 @@ else()
endif() endif()
endif() endif()
target_link_libraries(libzmq ${CMAKE_THREAD_LIBS_INIT}) target_link_libraries(libzmq ${SODIUM_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})
if(HAVE_WS2_32) if(HAVE_WS2_32)
target_link_libraries(libzmq ws2_32) target_link_libraries(libzmq ws2_32)
elseif(HAVE_WS2) elseif(HAVE_WS2)
......
...@@ -46,7 +46,7 @@ zmq::curve_client_t::curve_client_t (const options_t &options_) : ...@@ -46,7 +46,7 @@ zmq::curve_client_t::curve_client_t (const options_t &options_) :
randombytes(tmpbytes, 4); randombytes(tmpbytes, 4);
#else #else
const int si = sodium_init(); const int si = sodium_init();
zmq_assert (is == 0); zmq_assert (si == 0);
#endif #endif
// Generate short-term key pair // Generate short-term key pair
......
...@@ -51,7 +51,7 @@ zmq::curve_server_t::curve_server_t (session_base_t *session_, ...@@ -51,7 +51,7 @@ zmq::curve_server_t::curve_server_t (session_base_t *session_,
randombytes(tmpbytes, 4); randombytes(tmpbytes, 4);
#else #else
const int si = sodium_init(); const int si = sodium_init();
zmq_assert (is == 0); zmq_assert (si == 0);
#endif #endif
// Generate short-term key pair // Generate short-term key pair
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment