Skip to content
Snippets Groups Projects
Commit 15f9c462 authored by Nicolas Werner's avatar Nicolas Werner
Browse files

Reduce required boost components and use std::random instread of boost

parent 7bafeaae
No related branches found
No related tags found
No related merge requests found
......@@ -134,28 +134,12 @@ set_package_properties(nlohmann_json PROPERTIES
)
if(USE_BUNDLED_BOOST)
hunter_add_package(Boost
COMPONENTS atomic
chrono
date_time
iostreams
random
regex
system
thread)
hunter_add_package(Boost COMPONENTS iostreams system thread)
endif()
#set(Boost_USE_STATIC_LIBS OFF)
#set(Boost_USE_STATIC_RUNTIME OFF)
#set(Boost_USE_MULTITHREADED ON)
find_package(Boost 1.70
COMPONENTS atomic
chrono
date_time
iostreams
random
regex
system
thread)
find_package(Boost 1.70 COMPONENTS iostreams system thread)
set_package_properties(Boost PROPERTIES
DESCRIPTION "Free peer-reviewed portable C++ source libraries"
URL "https://www.boost.org/"
......@@ -226,12 +210,7 @@ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
target_link_libraries(matrix_client
PUBLIC
Boost::atomic
Boost::chrono
Boost::date_time
Boost::iostreams
Boost::random
Boost::regex
Boost::system
Boost::thread
libsodium::libsodium
......
......@@ -2,6 +2,7 @@
#include <cctype>
#include <iomanip>
#include <random>
#include <sstream>
#include <string>
#include <utility>
......@@ -14,8 +15,6 @@
#include <boost/iostreams/filter/zlib.hpp>
#include <boost/iostreams/filtering_stream.hpp>
#include <boost/iostreams/traits.hpp>
#include <boost/random/random_device.hpp>
#include <boost/random/uniform_int_distribution.hpp>
mtx::client::utils::MxcUrl
mtx::client::utils::parse_mxc_url(const std::string &url)
......@@ -59,8 +58,8 @@ mtx::client::utils::random_token(uint8_t len, bool with_symbols) noexcept
const auto chars = with_symbols ? alphanumberic + symbols : alphanumberic;
boost::random::random_device rng;
boost::random::uniform_int_distribution<> index_dist(0, chars.size() - 1);
std::random_device rng;
std::uniform_int_distribution<> index_dist(0, chars.size() - 1);
std::string token;
token.reserve(len);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment