mirror of
https://github.com/boostorg/redis.git
synced 2026-01-19 04:42:09 +00:00
In-tree cmake builds instead of FindBoost.
This commit is contained in:
@@ -19,13 +19,76 @@ target_compile_features(boost_redis INTERFACE cxx_std_17)
|
||||
|
||||
# Dependencies
|
||||
if (BOOST_REDIS_MAIN_PROJECT)
|
||||
# If we're the root project, error if a dependency is not found
|
||||
find_package(Boost 1.83 REQUIRED COMPONENTS headers)
|
||||
# TODO: Understand why we have to list all dependencies below
|
||||
# instead of
|
||||
#set(BOOST_INCLUDE_LIBRARIES redis)
|
||||
#set(BOOST_EXCLUDE_LIBRARIES redis)
|
||||
#add_subdirectory(../.. boostorg/boost EXCLUDE_FROM_ALL)
|
||||
|
||||
set(deps
|
||||
system
|
||||
assert
|
||||
config
|
||||
throw_exception
|
||||
asio
|
||||
variant2
|
||||
mp11
|
||||
winapi
|
||||
predef
|
||||
align
|
||||
context
|
||||
core
|
||||
coroutine
|
||||
static_assert
|
||||
pool
|
||||
date_time
|
||||
smart_ptr
|
||||
exception
|
||||
integer
|
||||
move
|
||||
type_traits
|
||||
algorithm
|
||||
utility
|
||||
io
|
||||
lexical_cast
|
||||
numeric/conversion
|
||||
mpl
|
||||
range
|
||||
tokenizer
|
||||
tuple
|
||||
array
|
||||
bind
|
||||
concept_check
|
||||
function
|
||||
iterator
|
||||
regex
|
||||
unordered
|
||||
preprocessor
|
||||
container
|
||||
conversion
|
||||
container_hash
|
||||
detail
|
||||
optional
|
||||
function_types
|
||||
fusion
|
||||
intrusive
|
||||
describe
|
||||
typeof
|
||||
functional
|
||||
test
|
||||
json
|
||||
)
|
||||
|
||||
foreach(dep IN LISTS deps)
|
||||
add_subdirectory(../${dep} boostorg/${dep})
|
||||
endforeach()
|
||||
|
||||
find_package(Threads REQUIRED)
|
||||
find_package(OpenSSL REQUIRED)
|
||||
target_link_libraries(boost_redis
|
||||
INTERFACE
|
||||
Boost::headers
|
||||
Boost::system
|
||||
Boost::asio
|
||||
Threads::Threads
|
||||
OpenSSL::Crypto
|
||||
OpenSSL::SSL
|
||||
|
||||
@@ -10,6 +10,9 @@ macro(make_example EXAMPLE_NAME STANDARD)
|
||||
if (${STANDARD} STREQUAL "20")
|
||||
target_link_libraries(${EXAMPLE_NAME} PRIVATE examples_main)
|
||||
endif()
|
||||
if (${STANDARD} STREQUAL "20")
|
||||
target_link_libraries(${EXAMPLE_NAME} PRIVATE Boost::json)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(make_testable_example EXAMPLE_NAME STANDARD)
|
||||
@@ -46,4 +49,4 @@ endif()
|
||||
|
||||
if (NOT MSVC)
|
||||
make_example(cpp20_chat_room 20)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -15,13 +15,11 @@
|
||||
|
||||
#if defined(BOOST_ASIO_HAS_CO_AWAIT)
|
||||
|
||||
#define BOOST_JSON_NO_LIB
|
||||
#define BOOST_CONTAINER_NO_LIB
|
||||
#include <boost/json/serialize.hpp>
|
||||
#include <boost/json/parse.hpp>
|
||||
#include <boost/json/value_from.hpp>
|
||||
#include <boost/json/value_to.hpp>
|
||||
#include <boost/redis/resp3/serialization.hpp>
|
||||
#include <boost/json/src.hpp>
|
||||
|
||||
namespace asio = boost::asio;
|
||||
using namespace boost::describe;
|
||||
|
||||
@@ -23,6 +23,7 @@ macro(make_test TEST_NAME STANDARD)
|
||||
boost_redis_src
|
||||
boost_redis_tests_common
|
||||
boost_redis_project_options
|
||||
Boost::unit_test_framework
|
||||
)
|
||||
target_compile_features(${EXE_NAME} PRIVATE cxx_std_${STANDARD})
|
||||
add_test(${EXE_NAME} ${EXE_NAME})
|
||||
@@ -70,4 +71,4 @@ add_custom_target(
|
||||
COMMAND ${COVERAGE_HTML_COMMAND}
|
||||
COMMENT "Generating coverage report"
|
||||
VERBATIM
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user