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
Christopher Kohlhoff ef6aec2abb Use new minimal boost_asio_core dependency.
Re-enable Boost.Asio in 32-bit MinGW-w64 job in AppVeyor.
2025-07-08 22:30:42 +10:00

139 lines
3.6 KiB
Plaintext

# log-build-config.jam
#
# Copyright 2023-2025 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 ;
# The rule checks if there is one of the defines listed in `flags` in `properties`. The value of the define is not considered.
rule has-config-flag ( flags + : properties * )
{
for local property in $(properties)
{
for local flag in $(flags)
{
if [ MATCH "^(<define>$(flag))(=.*)?$" : $(property) ]
{
return 1 ;
}
}
}
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 ! [ has-config-flag BOOST_LOG_WITHOUT_SETTINGS_PARSERS BOOST_LOG_WITHOUT_DEFAULT_FACTORIES BOOST_LOG_USE_STD_REGEX BOOST_LOG_USE_BOOST_XPRESSIVE : $(properties) ]
{
result = <conditional>@log-build-config.check-regex-header-only ;
}
return $(result) ;
}
rule check-asio ( properties * )
{
local result ;
if ! [ has-config-flag BOOST_LOG_WITHOUT_ASIO : $(properties) ]
{
result = <library>/boost/asio//boost_asio_core ;
}
return $(result) ;
}