Skip to content

Commit 6b1a95a

Browse files
authored
Merge pull request #217 from cppalliance/198
Make random optional
2 parents e42dee2 + baca67d commit 6b1a95a

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ target_link_libraries(boost_safe_numbers
1616
INTERFACE
1717
Boost::charconv
1818
Boost::core
19-
Boost::random
2019
Boost::throw_exception
2120
)
2221

include/boost/safe_numbers/fmt_format.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@
1111

1212
#ifndef BOOST_SAFE_NUMBERS_BUILD_MODULE
1313

14-
#include <fmt/format.h>
14+
#if __has_include(<fmt/format.h>)
15+
# include <fmt/format.h>
16+
#else
17+
# error "{fmt} is required in order to use this header"
18+
#endif
1519

1620
#endif // BOOST_SAFE_NUMBERS_BUILD_MODULE
1721

include/boost/safe_numbers/random.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@
2323
#pragma clang diagnostic ignored "-Wold-style-cast"
2424
#endif
2525

26-
#include <boost/random/uniform_int_distribution.hpp>
26+
#if __has_include(<boost/random/uniform_int_distribution.hpp>)
27+
# include <boost/random/uniform_int_distribution.hpp>
28+
#else
29+
# error "Boost.Random is required to use this file"
30+
#endif
2731

2832
#endif
2933

0 commit comments

Comments
 (0)