-
Notifications
You must be signed in to change notification settings - Fork 640
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for modular build structure. (#2905)
* Use beast exclusive valgrind feature. * Make the library modular usable. * Switch to library requirements instead of source. As source puts extra source in install targets. * Add Beast root dir for includes. As some tests refer to files relative to that. * Replace relative docca refs with project based. * Avoid mtuliple openssl configurations. * Always declare openssl. If it's empty and duplicate it will be ignored. * Add missing import-search for cconfig/predef checks. * Add requires-b2 check to top-level build file. * Bump B2 require to 5.2 * Update copyright dates. * Move inter-lib dependencies to a project variable and into the build targets. * Update build deps. * Update build deps. * The http/client/body example uses the source header from json instead of the linked library.
- Loading branch information
1 parent
aefc564
commit 2bda787
Showing
11 changed files
with
203 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# Copyright René Ferdinand Rivera Morell 2023-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 ; | ||
|
||
import feature ; | ||
|
||
constant boost_dependencies : | ||
/boost/asio//boost_asio | ||
/boost/assert//boost_assert | ||
/boost/bind//boost_bind | ||
/boost/config//boost_config | ||
/boost/container//boost_container | ||
/boost/container_hash//boost_container_hash | ||
/boost/core//boost_core | ||
/boost/endian//boost_endian | ||
/boost/intrusive//boost_intrusive | ||
/boost/logic//boost_logic | ||
/boost/mp11//boost_mp11 | ||
/boost/optional//boost_optional | ||
/boost/preprocessor//boost_preprocessor | ||
/boost/smart_ptr//boost_smart_ptr | ||
/boost/static_assert//boost_static_assert | ||
/boost/static_string//boost_static_string | ||
/boost/system//boost_system | ||
/boost/throw_exception//boost_throw_exception | ||
/boost/type_index//boost_type_index | ||
/boost/type_traits//boost_type_traits | ||
/boost/winapi//boost_winapi ; | ||
|
||
project /boost/beast | ||
: common-requirements | ||
<include>include | ||
; | ||
|
||
explicit | ||
[ alias boost_beast : build//boost_beast ] | ||
[ alias boost_beast_asio : build//boost_beast_asio ] | ||
[ alias boost_beast_asio_ssl : build//boost_beast_asio_ssl ] | ||
[ alias all : boost_beast boost_beast_asio boost_beast_asio_ssl example test ] | ||
# Old-style targets. Remove once the rest of Beast changes. | ||
[ alias lib-beast : boost_beast ] | ||
[ alias lib-asio : boost_beast_asio ] | ||
[ alias lib-asio-ssl : boost_beast_asio_ssl ] | ||
; | ||
|
||
call-if : boost-library beast | ||
: install boost_beast boost_beast_asio boost_beast_asio_ssl | ||
; | ||
|
||
feature.feature boost.beast.allow-deprecated : on off : propagated ; | ||
feature.feature boost.beast.separate-compilation : on off : propagated ; | ||
feature.feature boost.beast.valgrind : on off : optional propagated ; | ||
|
||
variant beast_coverage | ||
: debug | ||
: <cxxflags>"-msse4.2 --coverage" | ||
<linkflags>"--coverage" | ||
; | ||
|
||
variant beast_valgrind | ||
: release | ||
: <boost.beast.valgrind>on | ||
; | ||
|
||
variant beast_ubasan | ||
: release | ||
: <cxxflags>"-msse4.2 -funsigned-char -fno-omit-frame-pointer -fsanitize=address,undefined -fno-sanitize-recover=address,undefined -fsanitize-blacklist=libs/beast/tools/blacklist.supp" | ||
<linkflags>"-fsanitize=address,undefined" | ||
<define>BOOST_USE_ASAN=1 | ||
; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
# Copyright René Ferdinand Rivera Morell 2023-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) | ||
|
||
import ac ; | ||
import-search /boost/config/checks ; | ||
import config : requires ; | ||
import os ; | ||
import path ; | ||
|
||
local openssl-root ; | ||
if [ os.on-windows ] | ||
{ | ||
openssl-root ?= [ os.environ OPENSSL_ROOT ] ; | ||
if ! $(openssl-root) && [ path.glob "C:/OpenSSL" : lib include ] | ||
{ | ||
openssl-root = "C:/OpenSSL" ; | ||
} | ||
} | ||
using openssl : : <search>$(openssl-root)/lib <include>$(openssl-root)/include ; | ||
|
||
project | ||
: source-location ../test | ||
: common-requirements | ||
<library>$(boost_dependencies) | ||
[ requires | ||
cxx11_constexpr | ||
cxx11_decltype | ||
cxx11_hdr_tuple | ||
cxx11_template_aliases | ||
cxx11_variadic_templates | ||
] | ||
<define>BOOST_ALL_NO_LIB=1 | ||
<define>BOOST_ASIO_SEPARATE_COMPILATION | ||
<define>BOOST_ASIO_NO_DEPRECATED=1 | ||
<define>BOOST_ASIO_DISABLE_BOOST_ARRAY=1 | ||
<define>BOOST_ASIO_DISABLE_BOOST_BIND=1 | ||
<define>BOOST_ASIO_DISABLE_BOOST_DATE_TIME=1 | ||
<define>BOOST_ASIO_DISABLE_BOOST_REGEX=1 | ||
<define>BOOST_COROUTINES_NO_DEPRECATION_WARNING=1 | ||
<toolset>msvc:<cxxflags>"/bigobj" | ||
<toolset>msvc-14.1:<cxxflags>"/permissive-" | ||
<toolset>msvc-14.2:<cxxflags>"/permissive-" | ||
<toolset>msvc:<define>_SCL_SECURE_NO_WARNINGS=1 | ||
<toolset>msvc:<define>_CRT_SECURE_NO_WARNINGS=1 | ||
<toolset>msvc:<define>_SILENCE_CXX17_ALLOCATOR_VOID_DEPRECATION_WARNING | ||
<toolset>msvc:<define>_SILENCE_CXX17_ADAPTOR_TYPEDEFS_DEPRECATION_WARNING | ||
<toolset>msvc,<variant>release:<cxxflags>"/Ob2 /Oi /Ot" | ||
<target-os>linux:<define>_XOPEN_SOURCE=600 | ||
<target-os>linux:<define>_GNU_SOURCE=1 | ||
<target-os>solaris:<define>_XOPEN_SOURCE=500 | ||
<target-os>solaris:<define>__EXTENSIONS__ | ||
<target-os>solaris:<library>socket | ||
<target-os>solaris:<library>nsl | ||
<target-os>windows:<define>_WIN32_WINNT=0x0601 | ||
<target-os>windows,<toolset>gcc:<library>ws2_32 | ||
<target-os>windows,<toolset>gcc:<library>mswsock | ||
<target-os>windows,<toolset>gcc-cygwin:<define>__USE_W32_SOCKETS | ||
<target-os>hpux,<toolset>gcc:<define>_XOPEN_SOURCE_EXTENDED | ||
<target-os>hpux:<library>ipv6 | ||
<target-os>qnxnto:<library>socket | ||
<target-os>haiku:<library>network | ||
<boost.beast.valgrind>on:<define>BOOST_USE_VALGRIND | ||
<boost.beast.allow-deprecated>on:<define>BOOST_BEAST_ALLOW_DEPRECATED | ||
<boost.beast.separate-compilation>on:<define>BOOST_BEAST_SEPARATE_COMPILATION | ||
; | ||
|
||
explicit | ||
[ searched-lib socket ] # SOLARIS, QNXNTO | ||
[ searched-lib nsl ] # SOLARIS | ||
[ searched-lib ws2_32 : : <target-os>windows ] # NT | ||
[ searched-lib mswsock : : <target-os>windows ] # NT | ||
[ searched-lib ipv6 ] # HPUX | ||
[ searched-lib network ] # HAIKU | ||
; | ||
|
||
lib boost_beast_asio | ||
: lib_asio.cpp | ||
: requirements | ||
<link>static | ||
; | ||
|
||
lib boost_beast_asio_ssl | ||
: lib_asio_ssl.cpp | ||
: requirements | ||
<link>static | ||
[ 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 | ||
[ ac.check-library /openssl//ssl : <library>/openssl//ssl/<link>shared : <build>no ] | ||
[ ac.check-library /openssl//crypto : <library>/openssl//crypto/<link>shared : <build>no ] | ||
; | ||
|
||
lib boost_beast | ||
: lib_beast.cpp | ||
: requirements | ||
<link>static | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.