2
0
mirror of https://github.com/boostorg/log.git synced 2026-01-19 04:22:09 +00:00
Files
log/build/log-build-config.jam
René Ferdinand Rivera Morell 2530a4e03a Add support for modular build structure. (#233)
* Make the library modular usable.

* Switch to library requirements instead of source. As source puts extra source in install targets.

* Clean up build dependencies.

* Remove external build references and avoid custom project loading.

* Use relative paths to declare config sub-projects.

* Add missing NO_LIB usage requirements.

* Add missing library ref.

* Add missing import-search for cconfig/predef checks.

* Add requires-b2 check to top-level build file.

* Update dependencies.

* Bump B2 require to 5.2

* Update copyright dates.

* Move inter-lib dependencies to a project variable and into the build targets.

* Remove custom symbolic project names for config subprojects. And use project root relative targets.

* Move private deps to the build project.

* Put back default boost locale link as locale build is now fixed.

* Set default address-model and architecture to avoid extra/custom detection logic. Put back missing check and config rules.

* Adjust doc build to avoid boost-root references.

* Fix ref to predef.jam location.

* Have B2 build use same deps as CML for per-target private/public.

* Add log dep to log_setup, as it's needed on some platforms.

* Add boost_log_with_support target to mirror CML.

* Fix platform specific winapi dependency spec.
2025-05-26 00:48:16 +03:00

126 lines
3.4 KiB
Plaintext

# log-build-config.jam
#
# Copyright 2023 Andrey Semashev
#
# 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 configure ;
import project ;
import path ;
import property ;
import feature ;
rule has-config-flag ( flag : properties * )
{
if ( "<define>$(flag)" in $(properties) || "<define>$(flag)=1" in $(properties) )
{
return 1 ;
}
else
{
return ;
}
}
rule check-regex-header-only ( properties * )
{
local result ;
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 ;
}
return $(result) ;
}
rule check-atomic-int32 ( properties * )
{
local result ;
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 ;
}
return $(result) ;
}
rule check-pthread-mutex-robust ( properties * )
{
local result ;
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 ;
}
return $(result) ;
}
rule check-native-syslog ( properties * )
{
local result ;
if ! [ has-config-flag BOOST_LOG_WITHOUT_SYSLOG : $(properties) ]
{
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 ;
}
}
return $(result) ;
}
rule check-message-compiler ( properties * )
{
local result ;
if <target-os>windows in $(properties)
{
if ! [ has-config-flag BOOST_LOG_WITHOUT_EVENT_LOG : $(properties) ]
{
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 ;
}
}
else
{
# This branch is needed to fix building with MinGW
result = <define>BOOST_LOG_WITHOUT_EVENT_LOG ;
}
}
else
{
result = <define>BOOST_LOG_WITHOUT_EVENT_LOG ;
}
return $(result) ;
}
rule select-regex-backend ( properties * )
{
local result ;
# Use Boost.Regex backend by default. It produces smaller executables and also has the best performance for small string matching.
if ! (
[ log-build-config.has-config-flag BOOST_LOG_WITHOUT_SETTINGS_PARSERS : $(properties) ] ||
[ log-build-config.has-config-flag BOOST_LOG_WITHOUT_DEFAULT_FACTORIES : $(properties) ] ||
[ log-build-config.has-config-flag BOOST_LOG_USE_STD_REGEX : $(properties) ] ||
[ log-build-config.has-config-flag BOOST_LOG_USE_BOOST_XPRESSIVE : $(properties) ] )
{
result = <conditional>@log-build-config.check-regex-header-only ;
}
return $(result) ;
}