Skip to content

Commit abde1af

Browse files
Add support for modular build structure. (#204)
* Fixes issue 181. * Refactors add_hello and adds unit tests. * Adds endian to the list of dependencies * Make the library modular usable. * Some fixes in the article about the costs of async abstractions [skip ci] * Switch to library requirements instead of source. As source puts extra source in install targets. * Add missing import-search for cconfig/predef checks. * Add requires-b2 check to top-level build file. * Bump B2 require to 5.2 * Move inter-lib dependencies to a project variable and into the build targets. * Update build deps. * Fix spurious semi-colon. --------- Co-authored-by: Marcelo Zimbres <[email protected]>
1 parent e8dd4d6 commit abde1af

File tree

2 files changed

+35
-5
lines changed

2 files changed

+35
-5
lines changed

build.jam

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Copyright René Ferdinand Rivera Morell 2024
2+
# Distributed under the Boost Software License, Version 1.0.
3+
# (See accompanying file LICENSE_1_0.txt or copy at
4+
# http://www.boost.org/LICENSE_1_0.txt)
5+
6+
require-b2 5.2 ;
7+
8+
constant boost_dependencies :
9+
/boost/asio//boost_asio
10+
/boost/assert//boost_assert
11+
/boost/core//boost_core
12+
/boost/mp11//boost_mp11
13+
/boost/system//boost_system
14+
/boost/throw_exception//boost_throw_exception ;
15+
16+
project /boost/redis
17+
: common-requirements
18+
<include>include
19+
;
20+
21+
explicit
22+
[ alias boost_redis : : : : <library>$(boost_dependencies) ]
23+
[ alias all : boost_redis test ]
24+
;
25+
26+
call-if : boost-library redis
27+
;
28+

test/Jamfile

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11

2-
import ../config/checks/config : requires ;
2+
import-search /boost/config/checks ;
3+
import config : requires ;
34
import ac ;
45

56
# Configure openssl if it hasn't been done yet
67
using openssl ;
78

89
# Use these requirements as both regular and usage requirements across all tests
9-
local requirements =
10+
local requirements =
11+
<library>/boost/redis//boost_redis
1012
<define>BOOST_ASIO_NO_DEPRECATED=1
1113
<define>BOOST_ASIO_DISABLE_BOOST_ARRAY=1
1214
<define>BOOST_ASIO_DISABLE_BOOST_BIND=1
1315
<define>BOOST_ASIO_DISABLE_BOOST_DATE_TIME=1
1416
<define>BOOST_ASIO_DISABLE_BOOST_REGEX=1
1517
<toolset>msvc:<cxxflags>"/bigobj"
1618
<target-os>windows:<define>_WIN32_WINNT=0x0601
17-
<include>../include
1819
[ requires
1920
cxx14_constexpr
2021
cxx14_generic_lambdas
@@ -30,6 +31,7 @@ local requirements =
3031
]
3132
[ ac.check-library /openssl//ssl : <library>/openssl//ssl/<link>shared : <build>no ]
3233
[ ac.check-library /openssl//crypto : <library>/openssl//crypto/<link>shared : <build>no ]
34+
<library>/boost/test//boost_unit_test_framework
3335
;
3436

3537

@@ -44,7 +46,7 @@ lib redis_test_common
4446

4547
# B2 runs tests in parallel, and some tests rely on having exclusive
4648
# access to a Redis server, so we only run the ones that don't require a DB server.
47-
local tests =
49+
local tests =
4850
test_low_level_sync_sans_io
4951
test_low_level
5052
test_request
@@ -54,7 +56,7 @@ local tests =
5456
# Build and run the tests
5557
for local test in $(tests)
5658
{
57-
run
59+
run
5860
$(test).cpp
5961
redis_test_common/<link>static
6062
: target-name $(test)

0 commit comments

Comments
 (0)