Skip to content

Commit 066183c

Browse files
committed
Implement boost superproject CI
1 parent 0692319 commit 066183c

17 files changed

Lines changed: 763 additions & 103 deletions

File tree

.github/workflows/ci.yml

Lines changed: 617 additions & 71 deletions
Large diffs are not rendered by default.

CMakeLists.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ file(GLOB_RECURSE BOOST_COROSIO_HEADERS CONFIGURE_DEPENDS
132132
file(GLOB_RECURSE BOOST_COROSIO_SOURCES CONFIGURE_DEPENDS
133133
"${CMAKE_CURRENT_SOURCE_DIR}/src/*.hpp"
134134
"${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")
135+
# Exclude wolfssl files from main library (they are added separately when WolfSSL is found)
136+
list(FILTER BOOST_COROSIO_HEADERS EXCLUDE REGEX ".*/wolfssl/.*")
137+
list(FILTER BOOST_COROSIO_SOURCES EXCLUDE REGEX ".*/wolfssl/.*")
135138

136139
source_group("" FILES "include/boost/corosio.hpp")
137140
source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}/include/boost/corosio" PREFIX "include" FILES ${BOOST_COROSIO_HEADERS})
@@ -147,6 +150,7 @@ function(boost_corosio_setup_properties target)
147150
$<$<PLATFORM_ID:Windows>:ws2_32>)
148151
target_compile_definitions(${target} PUBLIC BOOST_COROSIO_NO_LIB)
149152
target_compile_definitions(${target} PRIVATE BOOST_COROSIO_SOURCE)
153+
target_compile_definitions(${target} PRIVATE $<$<PLATFORM_ID:Windows>:_WIN32_WINNT=0x0602>)
150154
if (BUILD_SHARED_LIBS)
151155
target_compile_definitions(${target} PUBLIC BOOST_COROSIO_DYN_LINK)
152156
else ()
@@ -157,6 +161,21 @@ function(boost_corosio_setup_properties target)
157161
$<$<CXX_COMPILER_ID:GNU>:-fcoroutines>)
158162
endfunction()
159163

164+
#-------------------------------------------------
165+
#
166+
# MrDocs Build (minimal for documentation)
167+
#
168+
#-------------------------------------------------
169+
if (BOOST_COROSIO_MRDOCS_BUILD)
170+
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/mrdocs.cpp"
171+
"#include <boost/corosio.hpp>\n")
172+
add_library(boost_corosio_mrdocs "${CMAKE_CURRENT_BINARY_DIR}/mrdocs.cpp")
173+
boost_corosio_setup_properties(boost_corosio_mrdocs)
174+
target_compile_definitions(boost_corosio_mrdocs PUBLIC BOOST_COROSIO_MRDOCS)
175+
set_target_properties(boost_corosio_mrdocs PROPERTIES EXPORT_COMPILE_COMMANDS ON)
176+
return()
177+
endif()
178+
160179
add_library(boost_corosio ${BOOST_COROSIO_HEADERS} ${BOOST_COROSIO_SOURCES})
161180
add_library(Boost::corosio ALIAS boost_corosio)
162181
boost_corosio_setup_properties(boost_corosio)

build/Jamfile

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import config : requires ;
1212

1313
constant c20-requires :
1414
[ requires
15-
cxx20_constexpr
15+
cxx20_hdr_concepts
1616
]
1717
;
1818

@@ -31,7 +31,15 @@ project boost/corosio
3131
: source-location $(COROSIO_ROOT)
3232
;
3333

34-
alias corosio_sources : [ glob-tree-ex $(COROSIO_ROOT)/src/src : *.cpp ] ;
34+
local COROSIO_SRC =
35+
[ glob $(COROSIO_ROOT)/src/*.cpp ]
36+
[ glob $(COROSIO_ROOT)/src/detail/*.cpp ]
37+
;
38+
39+
alias corosio_sources : $(COROSIO_SRC) ;
40+
41+
# System libraries
42+
lib ws2_32 ;
3543

3644
lib boost_corosio
3745
: corosio_sources
@@ -40,6 +48,7 @@ lib boost_corosio
4048
<library>/boost/url//boost_url
4149
<library>/boost/system//boost_system
4250
<target-os>windows:<library>ws2_32
51+
<target-os>windows:<define>_WIN32_WINNT=0x0602
4352
<include>$(COROSIO_ROOT)/include
4453
<include>$(COROSIO_ROOT)/src
4554
: usage-requirements

include/boost/corosio/acceptor.hpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ namespace corosio {
6161
}
6262
@endcode
6363
*/
64-
class acceptor : public io_object
64+
class BOOST_COROSIO_DECL acceptor : public io_object
6565
{
6666
struct accept_awaitable
6767
{
@@ -123,14 +123,12 @@ class acceptor : public io_object
123123
124124
Closes the acceptor if open, cancelling any pending operations.
125125
*/
126-
BOOST_COROSIO_DECL
127126
~acceptor();
128127

129128
/** Construct an acceptor from an execution context.
130129
131130
@param ctx The execution context that will own this acceptor.
132131
*/
133-
BOOST_COROSIO_DECL
134132
explicit acceptor(capy::execution_context& ctx);
135133

136134
/** Construct an acceptor from an executor.
@@ -202,15 +200,13 @@ class acceptor : public io_object
202200
203201
@throws std::system_error on failure.
204202
*/
205-
BOOST_COROSIO_DECL
206203
void listen(endpoint ep, int backlog = 128);
207204

208205
/** Close the acceptor.
209206
210207
Releases acceptor resources. Any pending operations complete
211208
with `errc::operation_canceled`.
212209
*/
213-
BOOST_COROSIO_DECL
214210
void close();
215211

216212
/** Check if the acceptor is listening.
@@ -264,7 +260,6 @@ class acceptor : public io_object
264260
265261
All outstanding operations complete with `errc::operation_canceled`.
266262
*/
267-
BOOST_COROSIO_DECL
268263
void cancel();
269264

270265
struct acceptor_impl : io_object_impl

include/boost/corosio/io_context.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ namespace corosio {
4848
ioc.run(); // Process all queued work
4949
@endcode
5050
*/
51-
class io_context : public capy::execution_context
51+
class BOOST_COROSIO_DECL io_context : public capy::execution_context
5252
{
5353
public:
5454
class executor_type;
@@ -59,7 +59,6 @@ class io_context : public capy::execution_context
5959
available on the system. If more than one thread is available,
6060
thread-safe synchronization is used.
6161
*/
62-
BOOST_COROSIO_DECL
6362
io_context();
6463

6564
/** Construct an io_context with a concurrency hint.
@@ -68,7 +67,6 @@ class io_context : public capy::execution_context
6867
will call `run()`. If greater than 1, thread-safe
6968
synchronization is used internally.
7069
*/
71-
BOOST_COROSIO_DECL
7270
explicit
7371
io_context(unsigned concurrency_hint);
7472

include/boost/corosio/io_object.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace corosio {
3131
The implementation pointer is accessible to derived classes
3232
through the protected member `impl_`.
3333
*/
34-
class io_object
34+
class BOOST_COROSIO_DECL io_object
3535
{
3636
public:
3737
struct io_object_impl

include/boost/corosio/io_stream.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
namespace boost {
2525
namespace corosio {
2626

27-
class io_stream : public io_object
27+
class BOOST_COROSIO_DECL io_stream : public io_object
2828
{
2929
public:
3030
/** Initiate an asynchronous read operation.

include/boost/corosio/resolver.hpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ operator&=(resolve_flags& a, resolve_flags b) noexcept
136136
auto results = (co_await r.resolve("www.example.com", "https")).value();
137137
@endcode
138138
*/
139-
class resolver : public io_object
139+
class BOOST_COROSIO_DECL resolver : public io_object
140140
{
141141
struct resolve_awaitable
142142
{
@@ -198,14 +198,12 @@ class resolver : public io_object
198198
199199
Cancels any pending operations.
200200
*/
201-
BOOST_COROSIO_DECL
202201
~resolver();
203202

204203
/** Construct a resolver from an execution context.
205204
206205
@param ctx The execution context that will own this resolver.
207206
*/
208-
BOOST_COROSIO_DECL
209207
explicit resolver(capy::execution_context& ctx);
210208

211209
/** Construct a resolver from an executor.
@@ -313,7 +311,6 @@ class resolver : public io_object
313311
314312
All outstanding operations complete with `errc::operation_canceled`.
315313
*/
316-
BOOST_COROSIO_DECL
317314
void cancel();
318315

319316
public:

include/boost/corosio/socket.hpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ namespace corosio {
7070
auto bytes = (co_await s.read_some(buf)).value();
7171
@endcode
7272
*/
73-
class socket : public io_stream
73+
class BOOST_COROSIO_DECL socket : public io_stream
7474
{
7575
public:
7676
struct socket_impl : io_stream_impl
@@ -134,14 +134,12 @@ class socket : public io_stream
134134
135135
Closes the socket if open, cancelling any pending operations.
136136
*/
137-
BOOST_COROSIO_DECL
138137
~socket();
139138

140139
/** Construct a socket from an execution context.
141140
142141
@param ctx The execution context that will own this socket.
143142
*/
144-
BOOST_COROSIO_DECL
145143
explicit socket(capy::execution_context& ctx);
146144

147145
/** Construct a socket from an executor.
@@ -207,15 +205,13 @@ class socket : public io_stream
207205
208206
@throws std::system_error on failure.
209207
*/
210-
BOOST_COROSIO_DECL
211208
void open();
212209

213210
/** Close the socket.
214211
215212
Releases socket resources. Any pending operations complete
216213
with `errc::operation_canceled`.
217214
*/
218-
BOOST_COROSIO_DECL
219215
void close();
220216

221217
/** Check if the socket is open.
@@ -270,7 +266,6 @@ class socket : public io_stream
270266
271267
All outstanding operations complete with `errc::operation_canceled`.
272268
*/
273-
BOOST_COROSIO_DECL
274269
void cancel();
275270

276271
private:

include/boost/corosio/wolfssl_stream.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ namespace corosio {
4141
// Use secure stream for TLS communication
4242
@endcode
4343
*/
44-
class wolfssl_stream : public io_stream
44+
class BOOST_COROSIO_DECL wolfssl_stream : public io_stream
4545
{
4646
struct handshake_awaitable
4747
{
@@ -109,7 +109,6 @@ class wolfssl_stream : public io_stream
109109
110110
@param stream Reference to the underlying stream to wrap.
111111
*/
112-
BOOST_COROSIO_DECL
113112
explicit
114113
wolfssl_stream(io_stream& stream);
115114

@@ -161,7 +160,7 @@ class wolfssl_stream : public io_stream
161160
};
162161

163162
private:
164-
BOOST_COROSIO_DECL void construct();
163+
void construct();
165164

166165
wolfssl_stream_impl& get() const noexcept
167166
{

0 commit comments

Comments
 (0)