Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for modular build structure. #233

Draft
wants to merge 29 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
b15ac8d
Make the library modular usable.
grafikrobot Mar 11, 2024
99ff55c
Switch to library requirements instead of source. As source puts extr…
grafikrobot Mar 30, 2024
163988d
Clean up build dependencies.
grafikrobot Apr 10, 2024
b134103
Remove external build references and avoid custom project loading.
grafikrobot Apr 10, 2024
c9e7629
Sync from upstream.
grafikrobot Apr 10, 2024
4323254
Use relative paths to declare config sub-projects.
grafikrobot Apr 13, 2024
9cf493d
Sync from upstream.
grafikrobot Apr 20, 2024
e41adee
Add missing NO_LIB usage requirements.
grafikrobot Apr 29, 2024
803e7fb
Add missing library ref.
grafikrobot Apr 29, 2024
0333e73
Add missing import-search for cconfig/predef checks.
grafikrobot May 5, 2024
e922356
Add requires-b2 check to top-level build file.
grafikrobot May 5, 2024
2fa69ed
Update dependencies.
grafikrobot May 14, 2024
40bc7c9
Sync from upstream.
grafikrobot May 20, 2024
747fef3
Bump B2 require to 5.2
grafikrobot Jun 14, 2024
f96d713
Sync from upstream.
grafikrobot Jun 16, 2024
3585ee8
Update copyright dates.
grafikrobot Jul 21, 2024
ef26b2f
Move inter-lib dependencies to a project variable and into the build …
grafikrobot Jul 24, 2024
1590c12
Remove custom symbolic project names for config subprojects. And use …
grafikrobot Jul 24, 2024
63c262e
Move private deps to the build project.
grafikrobot Jul 24, 2024
c3f43bc
Put back default boost locale link as locale build is now fixed.
grafikrobot Jul 25, 2024
3d42a6c
Set default address-model and architecture to avoid extra/custom dete…
grafikrobot Jul 25, 2024
4e1a3a2
Adjust doc build to avoid boost-root references.
grafikrobot Jul 28, 2024
fe85ada
Fix ref to predef.jam location.
grafikrobot Aug 3, 2024
14d7f62
Sync from upstream.
grafikrobot Aug 17, 2024
0d1a2b3
Sync from upstream.
grafikrobot Aug 20, 2024
bf3c459
Have B2 build use same deps as CML for per-target private/public.
grafikrobot Sep 5, 2024
9313e79
Add log dep to log_setup, as it's needed on some platforms.
grafikrobot Sep 5, 2024
994a46d
Add boost_log_with_support target to mirror CML.
grafikrobot Sep 5, 2024
37988de
Sync from upstream.
grafikrobot Oct 10, 2024
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
19 changes: 19 additions & 0 deletions build.jam
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# 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 ;

project /boost/log ;

explicit
[ alias boost_log : build//boost_log ]
[ alias boost_log_setup : build//boost_log_setup ]
[ alias boost_log_with_support : build//boost_log_with_support ]
[ alias all : boost_log boost_log_setup boost_log_with_support example test ]
;

call-if : boost-library log
: install boost_log boost_log_setup
;
147 changes: 112 additions & 35 deletions build/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -12,53 +12,120 @@ import path ;
import project ;
import feature ;
import configure ;
import-search /boost/config/checks ;
import config : requires ;
import log-arch-config ;
import log-platform-config ;
import log-build-config ;
import-search /boost/predef/tools/check ;
import predef ;

using mc ;

local here = [ modules.binding $(__name__) ] ;

project.push-current [ project.current ] ;
project.load [ path.join [ path.make $(here:D) ] ../config/x86-ext ] ;
project.pop-current ;

# Windows libs
lib psapi ;
lib advapi32 ;
lib secur32 ;
lib ws2_32 ;
lib mswsock ;
searched-lib psapi ;
searched-lib advapi32 ;
searched-lib secur32 ;
searched-lib ws2_32 ;
searched-lib mswsock ;
explicit psapi advapi32 secur32 ws2_32 mswsock ;

# UNIX libs
lib rt ;
lib socket ;
lib nsl ;
lib ipv6 ;
searched-lib rt ;
searched-lib socket ;
searched-lib nsl ;
searched-lib ipv6 ;
explicit rt socket nsl ipv6 ;

local log_cxx_public_requirements = [ requires
constant boost_log_public_deps :
<library>/boost/assert//boost_assert
<library>/boost/config//boost_config
<library>/boost/core//boost_core
<library>/boost/date_time//boost_date_time
<library>/boost/filesystem//boost_filesystem
<library>/boost/function_types//boost_function_types
<library>/boost/fusion//boost_fusion
<library>/boost/intrusive//boost_intrusive
<library>/boost/move//boost_move
<library>/boost/mpl//boost_mpl
<library>/boost/parameter//boost_parameter
<library>/boost/phoenix//boost_phoenix
<library>/boost/predef//boost_predef
<library>/boost/preprocessor//boost_preprocessor
<library>/boost/proto//boost_proto
<library>/boost/range//boost_range
<library>/boost/smart_ptr//boost_smart_ptr
<library>/boost/system//boost_system
<library>/boost/throw_exception//boost_throw_exception
<library>/boost/type_index//boost_type_index
<library>/boost/type_traits//boost_type_traits
<library>/boost/utility//boost_utility
<target-os>:<library>/boost/winapi//boost_winapi
[ requires
cxx11_static_assert
] ;
]
;

local log_cxx_private_requirements = [ requires
constant boost_log_private_deps :
<library>/boost/align//boost_align
<library>/boost/asio//boost_asio
<library>/boost/bind//boost_bind
<library>/boost/exception//boost_exception
<library>/boost/interprocess//boost_interprocess
<library>/boost/optional//boost_optional
<library>/boost/random//boost_random
<library>/boost/spirit//boost_spirit
[ requires
cxx11_lambdas
] ;
]
;

local log_setup_cxx_public_requirements = [ requires
constant boost_log_setup_public_deps :
<library>/boost/assert//boost_assert
<library>/boost/config//boost_config
<library>/boost/core//boost_core
<library>/boost/iterator//boost_iterator
<library>/boost/move//boost_move
<library>/boost/optional//boost_optional
<library>/boost/parameter//boost_parameter
<library>/boost/phoenix//boost_phoenix
<library>/boost/preprocessor//boost_preprocessor
<library>/boost/property_tree//boost_property_tree
<library>/boost/smart_ptr//boost_smart_ptr
<library>/boost/type_traits//boost_type_traits
[ requires
cxx11_static_assert
cxx11_unified_initialization_syntax
] ;
]
;

local log_setup_cxx_public_requirements = [ requires
constant boost_log_setup_private_deps :
<library>/boost/asio//boost_asio
<library>/boost/bind//boost_bind
<library>/boost/date_time//boost_date_time
<library>/boost/exception//boost_exception
<library>/boost/filesystem//boost_filesystem
<library>/boost/io//boost_io
<library>/boost/log//boost_log
<library>/boost/spirit//boost_spirit
<library>/boost/throw_exception//boost_throw_exception
<library>/boost/utility//boost_utility
[ requires
cxx11_lambdas
] ;
]
;

project boost/log
constant boost_log_support_public_deps :
<library>/boost/log//boost_log
<library>/boost/exception//boost_exception
<library>/boost/spirit//boost_spirit
<library>/boost/xpressive//boost_xpressive
;

project
: source-location ../src
: common-requirements
<include>../include
: requirements
<conditional>@log-arch-config.check-instruction-set
grafikrobot marked this conversation as resolved.
Show resolved Hide resolved
<conditional>@log-build-config.check-atomic-int32
Expand Down Expand Up @@ -129,6 +196,10 @@ project boost/log
<target-os>freebsd:<library>rt
<target-os>qnxnto:<library>socket
<toolset>pgi:<library>rt

# Set these to computed values according to the build.
[ predef.address-model ]
[ predef.architecture ]
: usage-requirements
<toolset>clang:<cxxflags>-Wno-bind-to-temporary-copy
<toolset>clang:<cxxflags>-Wno-unused-function
Expand Down Expand Up @@ -218,16 +289,16 @@ rule select-arch-specific-sources ( properties * )
{
local result ;

if x86 in [ log-arch-config.deduce-architecture $(properties) ]
if <architecture>x86 in $(properties)
grafikrobot marked this conversation as resolved.
Show resolved Hide resolved
{
local has_ssse3 = [ configure.builds /boost/log/x86-extensions//ssse3 : $(properties) : "compiler supports SSSE3" ] ;
local has_ssse3 = [ configure.builds /boost/log/config/x86-ext//ssse3 : $(properties) : "compiler supports SSSE3" ] ;
if $(has_ssse3)
{
result += <define>BOOST_LOG_USE_SSSE3 ;
result += <source>$(BOOST_LOG_COMMON_SSSE3_SRC) ;
}

local has_avx2 = [ configure.builds /boost/log/x86-extensions//avx2 : $(properties) : "compiler supports AVX2" ] ;
local has_avx2 = [ configure.builds /boost/log/config/x86-ext//avx2 : $(properties) : "compiler supports AVX2" ] ;
if $(has_avx2)
{
result += <define>BOOST_LOG_USE_AVX2 ;
Expand Down Expand Up @@ -302,13 +373,14 @@ lib boost_log
<conditional>@select-platform-specific-sources
<link>shared:<define>BOOST_LOG_DLL
<define>BOOST_LOG_BUILDING_THE_LIB=1
$(log_cxx_public_requirements)
$(log_cxx_private_requirements)
$(boost_log_private_deps)
$(boost_log_public_deps)
: ## default-build ##
: ## usage-requirements ##
<link>shared:<define>BOOST_LOG_DYN_LINK=1
<threading>single:<define>BOOST_LOG_NO_THREADS
$(log_cxx_public_requirements)
<define>BOOST_LOG_NO_LIB=1
grafikrobot marked this conversation as resolved.
Show resolved Hide resolved
$(boost_log_public_deps)
;


Expand Down Expand Up @@ -344,14 +416,19 @@ lib boost_log_setup
<link>shared:<define>BOOST_LOG_DYN_LINK=1
<link>shared:<define>BOOST_LOG_SETUP_DLL
<define>BOOST_LOG_SETUP_BUILDING_THE_LIB=1
$(log_setup_cxx_public_requirements)
$(log_setup_cxx_private_requirements)
<library>boost_log
$(boost_log_setup_private_deps)
$(boost_log_setup_public_deps)
: ## default-build ##
: ## usage-requirements ##
<link>shared:<define>BOOST_LOG_SETUP_DYN_LINK=1
<threading>single:<define>BOOST_LOG_NO_THREADS
$(log_setup_cxx_public_requirements)
<define>BOOST_LOG_SETUP_NO_LIB=1
$(boost_log_setup_public_deps)
;

boost-install boost_log boost_log_setup ;
alias boost_log_with_support
: requirements
$(boost_log_support_public_deps)
: usage-requirements
$(boost_log_support_public_deps)
;
59 changes: 6 additions & 53 deletions build/log-arch-config.jam
Original file line number Diff line number Diff line change
Expand Up @@ -13,68 +13,22 @@ import path ;
import property ;
import feature ;

local here = [ modules.binding $(__name__) ] ;

project.push-current [ project.current ] ;
project.load [ path.join [ path.make $(here:D) ] ../../config/checks/architecture ] ;
project.pop-current ;

rule deduce-address-model ( properties * )
{
local address_model = [ feature.get-values "address-model" : $(properties) ] ;
if $(address_model)
{
return $(address_model) ;
}
else
{
if [ configure.builds /boost/architecture//32 : $(properties) : 32-bit ]
{
return 32 ;
}
else if [ configure.builds /boost/architecture//64 : $(properties) : 64-bit ]
{
return 64 ;
}
}
# The address-model is always set to a deduced value using the predef.address-model checks.
return [ feature.get-values <address-model> : $(properties) ] ;
}

rule deduce-architecture ( properties * )
{
local architecture = [ feature.get-values "architecture" : $(properties) ] ;
if $(architecture)
{
return $(architecture) ;
}
else
{
if [ configure.builds /boost/architecture//x86 : $(properties) : x86 ]
{
return x86 ;
}
else if [ configure.builds /boost/architecture//arm : $(properties) : arm ]
{
return arm ;
}
else if [ configure.builds /boost/architecture//mips : $(properties) : mips ]
{
return mips ;
}
else if [ configure.builds /boost/architecture//power : $(properties) : power ]
{
return power ;
}
else if [ configure.builds /boost/architecture//sparc : $(properties) : sparc ]
{
return sparc ;
}
}
# The architecture is always set to a deduced value using the predef.architecture checks.
return [ feature.get-values <architecture> : $(properties) ] ;
}

rule deduce-instruction-set ( properties * )
{
local result ;
local instruction_set = [ feature.get-values "instruction-set" : $(properties) ] ;
local instruction_set = [ feature.get-values <instruction-set> : $(properties) ] ;

if $(instruction_set)
{
Expand All @@ -95,7 +49,6 @@ rule deduce-instruction-set ( properties * )
rule ssse3-flags ( properties * )
{
local result ;
grafikrobot marked this conversation as resolved.
Show resolved Hide resolved

if <toolset>intel in $(properties)
{
if <toolset-intel:platform>win in $(properties)
Expand All @@ -111,7 +64,7 @@ rule ssse3-flags ( properties * )
{
# MSVC doesn't really care about these switches, all SSE intrinsics are always available, but still...
# Also 64 bit MSVC doesn't have the /arch:SSE2 switch as it is the default.
if 32 in [ deduce-address-model $(properties) ]
if <address-model>32 in $(properties)
{
result = <cxxflags>"/arch:SSE2" ;
}
Expand Down
20 changes: 5 additions & 15 deletions build/log-build-config.jam
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,6 @@ import path ;
import property ;
import feature ;

local here = [ modules.binding $(__name__) ] ;

project.push-current [ project.current ] ;
project.load [ path.join [ path.make $(here:D) ] ../config/message-compiler ] ;
project.load [ path.join [ path.make $(here:D) ] ../config/pthread-mutex-robust ] ;
project.load [ path.join [ path.make $(here:D) ] ../config/native-syslog ] ;
project.load [ path.join [ path.make $(here:D) ] ../config/atomic-int32 ] ;
project.load [ path.join [ path.make $(here:D) ] ../config/regex-header-only ] ;
project.pop-current ;

grafikrobot marked this conversation as resolved.
Show resolved Hide resolved
rule has-config-flag ( flag : properties * )
{
if ( "<define>$(flag)" in $(properties) || "<define>$(flag)=1" in $(properties) )
Expand All @@ -38,7 +28,7 @@ rule check-regex-header-only ( properties * )
{
local result ;

local has_regex_header_only = [ configure.builds /boost/log/regex-header-only//regex_header_only : $(properties) : "Boost.Regex is header-only" ] ;
local has_regex_header_only = [ configure.builds /boost/log/config/regex-header-only//regex_header_only : $(properties) : "Boost.Regex is header-only" ] ;
if ! $(has_regex_header_only)
{
result = <library>/boost/regex//boost_regex ;
Expand All @@ -51,7 +41,7 @@ rule check-atomic-int32 ( properties * )
{
local result ;

local has_atomic_int32 = [ configure.builds /boost/log/atomic-int32//atomic_int32 : $(properties) : "native atomic int32 supported" ] ;
local has_atomic_int32 = [ configure.builds /boost/log/config/atomic-int32//atomic_int32 : $(properties) : "native atomic int32 supported" ] ;
if ! $(has_atomic_int32)
{
result = <define>BOOST_LOG_WITHOUT_IPC ;
Expand All @@ -64,7 +54,7 @@ rule check-pthread-mutex-robust ( properties * )
{
local result ;

local has_pthread_mutex_robust = [ configure.builds /boost/log/pthread-mutex-robust//pthread_mutex_robust : $(properties) : "pthread supports robust mutexes" ] ;
local has_pthread_mutex_robust = [ configure.builds /boost/log/config/pthread-mutex-robust//pthread_mutex_robust : $(properties) : "pthread supports robust mutexes" ] ;
if $(has_pthread_mutex_robust)
{
result = <define>BOOST_LOG_HAS_PTHREAD_MUTEX_ROBUST ;
Expand All @@ -79,7 +69,7 @@ rule check-native-syslog ( properties * )

if ! [ has-config-flag BOOST_LOG_WITHOUT_SYSLOG : $(properties) ]
{
local has_native_syslog = [ configure.builds /boost/log/native-syslog//native_syslog : $(properties) : "native syslog supported" ] ;
local has_native_syslog = [ configure.builds /boost/log/config/native-syslog//native_syslog : $(properties) : "native syslog supported" ] ;
if $(has_native_syslog)
{
result = <define>BOOST_LOG_USE_NATIVE_SYSLOG ;
Expand All @@ -97,7 +87,7 @@ rule check-message-compiler ( properties * )
{
if ! [ has-config-flag BOOST_LOG_WITHOUT_EVENT_LOG : $(properties) ]
{
local has_mc = [ configure.builds /boost/log/message-compiler//test-availability : $(properties) : "has message compiler" ] ;
local has_mc = [ configure.builds /boost/log/config/message-compiler//test-availability : $(properties) : "has message compiler" ] ;
if ! $(has_mc)
{
result = <define>BOOST_LOG_WITHOUT_EVENT_LOG ;
Expand Down
Loading
Loading