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 15 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
66 changes: 66 additions & 0 deletions build.jam
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Copyright René Ferdinand Rivera Morell 2023
# 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
: common-requirements
<library>/boost/align//boost_align
grafikrobot marked this conversation as resolved.
Show resolved Hide resolved
<library>/boost/asio//boost_asio
<library>/boost/assert//boost_assert
<library>/boost/atomic//boost_atomic
<library>/boost/config//boost_config
<library>/boost/core//boost_core
<library>/boost/date_time//boost_date_time
<library>/boost/exception//boost_exception
<library>/boost/filesystem//boost_filesystem
<library>/boost/function_types//boost_function_types
<library>/boost/fusion//boost_fusion
<library>/boost/interprocess//boost_interprocess
<library>/boost/intrusive//boost_intrusive
<library>/boost/io//boost_io
<library>/boost/iterator//boost_iterator
<library>/boost/move//boost_move
<library>/boost/mpl//boost_mpl
<library>/boost/optional//boost_optional
<library>/boost/parameter//boost_parameter
<library>/boost/phoenix//boost_phoenix
<library>/boost/predef//boost_predef
<library>/boost/preprocessor//boost_preprocessor
<library>/boost/property_tree//boost_property_tree
<library>/boost/proto//boost_proto
<library>/boost/random//boost_random
<library>/boost/range//boost_range
<library>/boost/regex//boost_regex
<library>/boost/smart_ptr//boost_smart_ptr
<library>/boost/spirit//boost_spirit
<library>/boost/system//boost_system
<library>/boost/thread//boost_thread
<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
<library>/boost/winapi//boost_winapi
<library>/boost/xpressive//boost_xpressive
<include>include
;

use-project /boost/log/atomic-int32 : config/atomic-int32 ;
use-project /boost/log/message-compiler : config/message-compiler ;
use-project /boost/log/native-syslog : config/native-syslog ;
use-project /boost/log/pthread-mutex-robust : config/pthread-mutex-robust ;
use-project /boost/log/regex-header-only : config/regex-header-only ;
use-project /boost/log/x86-extensions : config/x86-ext ;
use-project /boost/log/xopen-source-600 : config/xopen-source-600 ;
grafikrobot marked this conversation as resolved.
Show resolved Hide resolved

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

call-if : boost-library log
: install boost_log boost_log_setup
;
34 changes: 14 additions & 20 deletions build/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,27 @@ 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 ;

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
Expand All @@ -57,10 +52,9 @@ local log_setup_cxx_public_requirements = [ requires
cxx11_lambdas
] ;

project boost/log
project
: source-location ../src
: 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
<conditional>@log-build-config.select-regex-backend
<conditional>@log-build-config.check-pthread-mutex-robust
Expand Down Expand Up @@ -214,7 +208,7 @@ 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" ] ;
if $(has_ssse3)
Expand Down Expand Up @@ -304,6 +298,7 @@ lib boost_log
: ## usage-requirements ##
<link>shared:<define>BOOST_LOG_DYN_LINK=1
<threading>single:<define>BOOST_LOG_NO_THREADS
<define>BOOST_LOG_NO_LIB=1
grafikrobot marked this conversation as resolved.
Show resolved Hide resolved
$(log_cxx_public_requirements)
;

Expand Down Expand Up @@ -347,7 +342,6 @@ lib boost_log_setup
: ## usage-requirements ##
<link>shared:<define>BOOST_LOG_SETUP_DYN_LINK=1
<threading>single:<define>BOOST_LOG_NO_THREADS
<define>BOOST_LOG_SETUP_NO_LIB=1
$(log_setup_cxx_public_requirements)
;

boost-install boost_log boost_log_setup ;
97 changes: 1 addition & 96 deletions build/log-arch-config.jam
Original file line number Diff line number Diff line change
Expand Up @@ -13,89 +13,8 @@ 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 ;
}
}
}

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 ;
}
}
}

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

if $(instruction_set)
{
result = $(instruction_set) ;
}
else
{
if x86 in [ deduce-architecture $(properties) ] && 32 in [ deduce-address-model $(properties) ]
{
# We build for Pentium Pro and later CPUs by default. This is used as the target in many Linux distributions, and Windows and OS X also seem to not support older CPUs.
result = i686 ;
}
}

return $(result) ;
}

grafikrobot marked this conversation as resolved.
Show resolved Hide resolved
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 +30,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 Expand Up @@ -157,18 +76,4 @@ rule avx2-flags ( properties * )

rule check-instruction-set ( properties * )
{
local result ;
local instruction_set = [ log-arch-config.deduce-instruction-set $(properties) ] ;

if $(instruction_set) = i386 || $(instruction_set) = i486
{
if ! $(.annouced-failure)
{
ECHO Boost.Log is not supported on the specified target CPU and will not be built. At least i586 class CPU is required. ;
.annouced-failure = 1 ;
}
result = <build>no ;
}

return $(result) ;
grafikrobot marked this conversation as resolved.
Show resolved Hide resolved
}
10 changes: 0 additions & 10 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 Down
6 changes: 0 additions & 6 deletions build/log-platform-config.jam
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +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/xopen-source-600 ] ;
project.pop-current ;

grafikrobot marked this conversation as resolved.
Show resolved Hide resolved
rule set-platform-defines ( properties * )
{
local result ;
Expand Down
2 changes: 1 addition & 1 deletion config/atomic-int32/Jamfile.jam
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#

import project ;
import log-platform-config ;
import ../../build/log-platform-config ;

project /boost/log/atomic-int32
: source-location .
Expand Down
Empty file added config/build.jam
Empty file.
2 changes: 1 addition & 1 deletion config/x86-ext/Jamfile.jam
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#

import project ;
import log-arch-config ;
import ../../build/log-arch-config ;

project /boost/log/x86-extensions
: source-location .
Expand Down
3 changes: 3 additions & 0 deletions example/doc/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ project
<library>/boost/date_time//boost_date_time
<library>/boost/filesystem//boost_filesystem
<library>/boost/thread//boost_thread
<library>/boost/lambda//boost_lambda
<library>/boost/scope_exit//boost_scope_exit
<library>/boost/format//boost_format
<threading>multi
;

Expand Down
2 changes: 1 addition & 1 deletion example/wide_char/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ project
<library>/boost/log//boost_log_setup
<library>/boost/date_time//boost_date_time
<library>/boost/filesystem//boost_filesystem
<library>/boost/locale//boost_locale
<library>/boost/locale//boost_locale/<link>static
grafikrobot marked this conversation as resolved.
Show resolved Hide resolved
<library>/boost/thread//boost_thread
<threading>multi

Expand Down
5 changes: 2 additions & 3 deletions test/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,9 @@ rule test_all

if ! [ os.environ BOOST_LOG_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS ]
{
local headers_path = [ path.make $(BOOST_ROOT)/libs/log/include/boost/log ] ;
for file in [ path.glob-tree $(headers_path) : *.hpp : detail ]
for file in [ glob-tree-ex ../include/boost/log : *.hpp : detail ]
grafikrobot marked this conversation as resolved.
Show resolved Hide resolved
{
local rel_file = [ path.relative-to $(headers_path) $(file) ] ;
local rel_file = [ path.relative-to ../include/boost/log $(file) ] ;
# Note: The test name starts with '~' in order to group these tests in the test report table, preferably at the end.
# All '/' are replaced with '-' because apparently test scripts have a problem with test names containing slashes.
local test_name = [ regex.replace ~hdr/$(rel_file) "/" "-" ] ;
Expand Down
Loading