Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 19 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
endif()

option(BOOST_COBALT_USE_BOOST_CONTAINER "Boost.Cobalt: Use boost.container instead of std::pmr" ${BOOST_COBALT_SHOULD_USE_CONTAINER})
option(BOOST_COBALT_ENABLE_IO_SSL "Boost.Cobalt: Build boost_cobalt_io_ssl target when OpenSSL is available" ON)

if (NOT BOOST_COBALT_IS_ROOT)
# Generated by `boostdep --cmake cobalt`
Expand Down Expand Up @@ -112,16 +113,18 @@ if (NOT BOOST_COBALT_IS_ROOT)
target_compile_definitions(boost_cobalt_io PRIVATE BOOST_COBALT_IO_SOURCE=1)
add_library(Boost::cobalt::io ALIAS boost_cobalt_io)

find_package(OpenSSL)
if (BOOST_COBALT_ENABLE_IO_SSL)
find_package(OpenSSL)

if (OPENSSL_FOUND)
add_library(boost_cobalt_io_ssl
src/io/ssl.cpp
)
if (OPENSSL_FOUND)
add_library(boost_cobalt_io_ssl
src/io/ssl.cpp
)

target_link_libraries(boost_cobalt_io_ssl PUBLIC boost_cobalt_io OpenSSL::SSL OpenSSL::Crypto)
target_compile_definitions(boost_cobalt_io_ssl PRIVATE BOOST_COBALT_SSL_SOURCE=1)
add_library(Boost::cobalt::io::ssl ALIAS boost_cobalt_io_ssl)
target_link_libraries(boost_cobalt_io_ssl PUBLIC boost_cobalt_io OpenSSL::SSL OpenSSL::Crypto)
target_compile_definitions(boost_cobalt_io_ssl PRIVATE BOOST_COBALT_SSL_SOURCE=1)
add_library(Boost::cobalt::io::ssl ALIAS boost_cobalt_io_ssl)
endif()
endif()

if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")
Expand Down Expand Up @@ -244,14 +247,16 @@ else()
target_compile_definitions(boost_cobalt_io PRIVATE BOOST_COBALT_IO_SOURCE=1)
add_library(Boost::cobalt::io ALIAS boost_cobalt_io)

find_package(OpenSSL)
if (BOOST_COBALT_ENABLE_IO_SSL)
find_package(OpenSSL)

if (OPENSSL_FOUND)
add_library(boost_cobalt_io_ssl src/io/ssl.cpp)
if (OPENSSL_FOUND)
add_library(boost_cobalt_io_ssl src/io/ssl.cpp)

target_link_libraries(boost_cobalt_io_ssl PUBLIC boost_cobalt_io OpenSSL::SSL OpenSSL::Crypto)
target_compile_definitions(boost_cobalt_io_ssl PRIVATE BOOST_COBALT_SSL_SOURCE=1)
add_library(Boost::cobalt::io::ssl ALIAS boost_cobalt_io_ssl)
target_link_libraries(boost_cobalt_io_ssl PUBLIC boost_cobalt_io OpenSSL::SSL OpenSSL::Crypto)
target_compile_definitions(boost_cobalt_io_ssl PRIVATE BOOST_COBALT_SSL_SOURCE=1)
add_library(Boost::cobalt::io::ssl ALIAS boost_cobalt_io_ssl)
endif()
endif()

if(BOOST_COBALT_INSTALL AND NOT BOOST_SUPERPROJECT_VERSION)
Expand Down
1 change: 1 addition & 0 deletions boost-cobalt.jam
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ import feature ;

feature.feature boost.cobalt.pmr : std boost-container custom no : propagated ;
feature.feature boost.cobalt.executor : any_io_executor use_io_context custom : propagated ;
feature.feature boost.cobalt.ssl : auto on off : propagated ;

4 changes: 3 additions & 1 deletion build.jam
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ project /boost/cobalt
explicit
[ alias boost_cobalt : build//boost_cobalt ]
[ alias boost_cobalt_io : build//boost_cobalt_io ]
[ alias boost_cobalt_io_ssl : build//boost_cobalt_io_ssl ]
[ alias boost_cobalt_io_ssl : build//boost_cobalt_io_ssl
: <boost.cobalt.ssl>off:<build>no
]
[ alias all : boost_cobalt boost_cobalt_io test example ]
;

Expand Down
1 change: 1 addition & 0 deletions build/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ lib boost_cobalt_io_ssl
: io/ssl.cpp boost_cobalt_io
: requirements <define>BOOST_COBALT_SSL_SOURCE=1
<link>shared:<define>BOOST_COBALT_DYN_LINK=1
<boost.cobalt.ssl>off:<build>no
[ ac.check-library /openssl//ssl : <library>/openssl//ssl/<link>shared : <build>no ]
[ ac.check-library /openssl//crypto : <library>/openssl//crypto/<link>shared : <build>no ]
: usage-requirements
Expand Down
Loading