diff --git a/boost-cobalt.jam b/boost-cobalt.jam new file mode 100644 index 00000000..6b2785d8 --- /dev/null +++ b/boost-cobalt.jam @@ -0,0 +1,19 @@ +# Copyright (c) 2023 Klemens D. Morgenstern +# +# Distributed under the Boost Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + +import feature ; + + +feature.feature boost.cobalt.pmr : std boost-container custom no : propagated composite ; +feature.compose std : BOOST_COBALT_USE_STD_PMR=1 ; +feature.compose boost-container : BOOST_COBALT_USE_BOOST_CONTAINER_PMR=1 ; +feature.compose custom : BOOST_COBALT_USE_CUSTOM_PMR=1 ; +feature.compose no : BOOST_COBALT_NO_PMR=1 ; + +feature.feature boost.cobalt.executor : any_io_executor use_io_context custom : propagated composite ; +feature.compose any_io_executor : ; +feature.compose use_io_context : BOOST_COBALT_USE_IO_CONTEXT=1 ; +feature.compose custom_executor : BOOST_COBALT_CUSTOM_EXECUTOR=1 ; diff --git a/build.jam b/build.jam new file mode 100644 index 00000000..d40de892 --- /dev/null +++ b/build.jam @@ -0,0 +1,37 @@ +# Copyright René Ferdinand Rivera Morell 2024 +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +require-b2 5.2 ; + +constant boost_dependencies : + /boost/asio//boost_asio + /boost/callable_traits//boost_callable_traits + /boost/circular_buffer//boost_circular_buffer + /boost/config//boost_config + /boost/container//boost_container + /boost/context//boost_context + /boost/core//boost_core + /boost/intrusive//boost_intrusive + /boost/leaf//boost_leaf + /boost/mp11//boost_mp11 + /boost/preprocessor//boost_preprocessor + /boost/smart_ptr//boost_smart_ptr + /boost/system//boost_system + /boost/throw_exception//boost_throw_exception + /boost/variant2//boost_variant2 ; + +project /boost/cobalt + : common-requirements + include + ; + +explicit + [ alias boost_cobalt : build//boost_cobalt ] + [ alias all : boost_cobalt test example ] + ; + +call-if : boost-library cobalt + ; + diff --git a/build/Jamfile b/build/Jamfile index 64695b91..c2b547d0 100644 --- a/build/Jamfile +++ b/build/Jamfile @@ -5,8 +5,10 @@ import os ; -import feature ; -import ../../config/checks/config : requires ; +import-search /boost/config/checks ; +import config : requires ; +import-search /boost/cobalt ; +import boost-cobalt ; project : requirements @@ -17,20 +19,10 @@ project : requirements windows:WIN32_LEAN_AND_MEAN linux:-lpthread : source-location ../src + : common-requirements $(boost_dependencies) ; -feature.feature boost.cobalt.pmr : std boost-container custom no : propagated composite ; -feature.compose std : BOOST_COBALT_USE_STD_PMR=1 ; -feature.compose boost-container : BOOST_COBALT_USE_BOOST_CONTAINER_PMR=1 ; -feature.compose custom : BOOST_COBALT_USE_CUSTOM_PMR=1 ; -feature.compose no : BOOST_COBALT_NO_PMR=1 ; - -feature.feature boost.cobalt.executor : any_io_executor use_io_context custom : propagated composite ; -feature.compose any_io_executor : ; -feature.compose use_io_context : BOOST_COBALT_USE_IO_CONTEXT=1 ; -feature.compose custom_executor : BOOST_COBALT_CUSTOM_EXECUTOR=1 ; - local config-binding = [ modules.binding config ] ; config-binding ?= "" ; @@ -50,10 +42,10 @@ lib boost_cobalt : cobalt_sources : requirements BOOST_COBALT_SOURCE=1 shared:BOOST_COBALT_DYN_LINK=1 - [ requires + [ requires cxx20_hdr_concepts ] - boost-container:/boost//container + boost-container:/boost/container//boost_container [ check-target-builds $(config-binding:D)//cpp_lib_memory_resource cpp_lib_memory_resource @@ -62,8 +54,9 @@ lib boost_cobalt ] : usage-requirements - boost-container:/boost//container + boost-container:/boost/container//boost_container shared:BOOST_COBALT_DYN_LINK=1 + BOOST_COBALT_NO_LINK=1 [ check-target-builds $(config-binding:D)//cpp_lib_memory_resource cpp_lib_memory_resource @@ -97,6 +90,3 @@ rule set-pmr-std ( props * ) return std ; } } - -boost-install boost_cobalt ; - diff --git a/example/Jamfile b/example/Jamfile index dbfa9768..dcf05328 100644 --- a/example/Jamfile +++ b/example/Jamfile @@ -5,6 +5,8 @@ import os ; +import-search /boost/cobalt ; +import boost-cobalt ; project : requirements @@ -18,12 +20,11 @@ project : requirements clang-14:boost-container ; -exe channel : channel.cpp /boost//cobalt ; -exe delay : delay.cpp /boost//cobalt ; -exe delay_op : delay_op.cpp /boost//cobalt ; -exe echo_server : echo_server.cpp /boost//cobalt ; -exe outcome : outcome.cpp /boost//cobalt ; -exe thread : thread.cpp /boost//cobalt ; -exe thread_pool : thread_pool.cpp /boost//cobalt ; -# exe ticker : ticker.cpp /boost//json /boost//cobalt ; - +exe channel : channel.cpp /boost/cobalt//boost_cobalt ; +exe delay : delay.cpp /boost/cobalt//boost_cobalt ; +exe delay_op : delay_op.cpp /boost/cobalt//boost_cobalt ; +exe echo_server : echo_server.cpp /boost/cobalt//boost_cobalt ; +exe outcome : outcome.cpp /boost/cobalt//boost_cobalt /boost/outcome//boost_outcome ; +exe thread : thread.cpp /boost/cobalt//boost_cobalt ; +exe thread_pool : thread_pool.cpp /boost/cobalt//boost_cobalt ; +# exe ticker : ticker.cpp /boost/cobalt//boost_cobalt /boost/json//boost_json ; diff --git a/test/Jamfile.jam b/test/Jamfile.jam index 696f22b7..25b1e7de 100644 --- a/test/Jamfile.jam +++ b/test/Jamfile.jam @@ -5,6 +5,8 @@ import os ; +import-search /boost/cobalt ; +import boost-cobalt ; project : requirements @@ -20,12 +22,12 @@ project : requirements import testing ; -lib test_impl : test_main.cpp /boost//cobalt /boost//unit_test_framework : +lib test_impl : test_main.cpp /boost/cobalt//boost_cobalt /boost/test//boost_unit_test_framework : static ; -run main.cpp /boost//cobalt ; -run main_compile.cpp /boost//cobalt util.cpp concepts.cpp ; +run main.cpp /boost/cobalt//boost_cobalt ; +run main_compile.cpp /boost/cobalt//boost_cobalt util.cpp concepts.cpp ; for local src in [ glob *.cpp : main.cpp main_compile.cpp test_main.cpp concepts.cpp util.cpp ] {