2
0
mirror of https://github.com/boostorg/log.git synced 2026-01-19 04:22:09 +00:00
Files
log/build/Jamfile.v2
Andrey Semashev 3ea24c81f2 Enable building IPC components on Cygwin.
Reportedly, Boost.Interprocess has been fixed on Cygwin, so we can enable
building IPC components by default on this target.

Refs https://github.com/boostorg/interprocess/issues/242.
2025-12-14 03:09:14 +03:00

432 lines
14 KiB
Plaintext

#
# Copyright Andrey Semashev 2007 - 2025.
# 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 common ;
import modules ;
import os ;
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 ;
# Windows libs
lib psapi ;
lib advapi32 ;
lib secur32 ;
lib ws2_32 ;
lib mswsock ;
explicit psapi advapi32 secur32 ws2_32 mswsock ;
# UNIX libs
lib rt ;
lib socket ;
lib nsl ;
lib ipv6 ;
explicit rt socket nsl ipv6 ;
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>windows:<library>/boost/winapi//boost_winapi
[ requires
cxx11_static_assert
]
;
constant boost_log_private_deps :
<library>/boost/align//boost_align
<library>/boost/bind//boost_bind
<library>/boost/exception//boost_exception
<library>/boost/interprocess//boost_interprocess
<library>/boost/optional//boost_optional
<library>/boost/spirit//boost_spirit
<conditional>@log-build-config.check-asio
[ requires
cxx11_lambdas
]
;
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
]
;
constant boost_log_setup_private_deps :
<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
<conditional>@log-build-config.check-asio
[ requires
cxx11_lambdas
]
;
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
<conditional>@log-build-config.check-atomic-int32
<conditional>@log-build-config.select-regex-backend
<conditional>@log-build-config.check-pthread-mutex-robust
<conditional>@log-build-config.check-native-syslog
<conditional>@log-build-config.check-message-compiler
<conditional>@log-platform-config.set-platform-defines
<include>../src
<define>__STDC_CONSTANT_MACROS # Use system-defined macros for integer constants, if possible
<define>BOOST_SPIRIT_USE_PHOENIX_V3=1
<define>BOOST_THREAD_DONT_USE_CHRONO=1 # Don't introduce false dependency on Boost.Chrono
<c++-template-depth>1024
<toolset>msvc:<cxxflags>/bigobj
<toolset>msvc:<cxxflags>/wd4503 # decorated name length exceeded, name was truncated
<toolset>msvc:<cxxflags>/wd4456 # declaration of 'A' hides previous local declaration
<toolset>msvc:<cxxflags>/wd4459 # declaration of 'A' hides global declaration
<toolset>msvc:<cxxflags>/wd4003 # not enough actual parameters for macro 'X' - caused by BOOST_PP_IS_EMPTY and BOOST_PP_IS_BEGIN_PARENS which are used by Fusion
# Disable Intel warnings:
# warning #177: function "X" was declared but never referenced
# warning #780: using-declaration ignored -- it refers to the current namespace
# warning #2196: routine is both "inline" and "noinline"
# remark #1782: #pragma once is obsolete. Use #ifndef guard instead.
# remark #193: zero used for undefined preprocessing identifier "X"
# remark #304: access control not specified ("public" by default)
# remark #981: operands are evaluated in unspecified order
# remark #1418: external function definition with no prior declaration
# Mostly comes from Boost.Phoenix: warning #411: class "X" defines no constructor to initialize the following: reference member "Y"...
# warning #734: "X" (declared at line N of "file.hpp"), required for copy that was eliminated, is inaccessible
# warning #279: controlling expression is constant
<toolset>intel-win:<cxxflags>"/Qwd177,780,2196,1782,193,304,981,1418,411,734,279"
<toolset>intel-linux:<cxxflags>"-wd177,780,2196,1782,193,304,981,1418,411,734,279"
<toolset>intel-darwin:<cxxflags>"-wd177,780,2196,1782,193,304,981,1418,411,734,279"
<toolset>gcc:<cxxflags>-fno-strict-aliasing # avoids strict aliasing violations in other Boost components
<toolset>gcc,<target-os>windows:<linkflags>-Wl,--enable-auto-import
<toolset>gcc,<target-os>cygwin:<linkflags>-Wl,--enable-auto-import
<library>/boost/filesystem//boost_filesystem
<threading>single:<define>BOOST_LOG_NO_THREADS
<threading>multi:<library>/boost/atomic//boost_atomic
<threading>multi:<library>/boost/thread//boost_thread
<target-os>windows:<define>BOOST_USE_WINDOWS_H
<target-os>windows:<library>ws2_32
<target-os>windows:<library>mswsock
<target-os>windows:<library>advapi32
<target-os>cygwin:<define>BOOST_USE_WINDOWS_H
<target-os>cygwin:<library>ws2_32
<target-os>cygwin:<library>mswsock
<target-os>cygwin:<library>advapi32
<target-os>linux:<library>rt
<target-os>solaris:<library>socket
<target-os>solaris:<library>nsl
<target-os>hpux:<library>ipv6
<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
<threading>single:<define>BOOST_LOG_NO_THREADS
<threading>multi:<library>/boost/atomic//boost_atomic
<threading>multi:<library>/boost/thread//boost_thread
;
local BOOST_LOG_COMMON_SRC =
attribute_name.cpp
attribute_set.cpp
attribute_value_set.cpp
code_conversion.cpp
core.cpp
record_ostream.cpp
severity_level.cpp
global_logger_storage.cpp
named_scope.cpp
process_name.cpp
process_id.cpp
thread_id.cpp
timer.cpp
exceptions.cpp
default_attribute_names.cpp
default_sink.cpp
text_ostream_backend.cpp
text_file_backend.cpp
text_multifile_backend.cpp
thread_specific.cpp
once_block.cpp
timestamp.cpp
threadsafe_queue.cpp
event.cpp
trivial.cpp
spirit_encoding.cpp
format_parser.cpp
date_time_format_parser.cpp
named_scope_format_parser.cpp
permissions.cpp
dump.cpp
;
BOOST_LOG_COMMON_SSSE3_SRC =
dump_ssse3
;
BOOST_LOG_COMMON_AVX2_SRC =
dump_avx2
;
for local src in $(BOOST_LOG_COMMON_SSSE3_SRC)
{
obj $(src)
: ## sources ##
$(src).cpp
: ## requirements ##
<conditional>@log-arch-config.ssse3-flags
<link>shared:<define>BOOST_LOG_DLL
<define>BOOST_LOG_BUILDING_THE_LIB=1
: ## default-build ##
: ## usage-requirements ##
<define>BOOST_LOG_USE_SSSE3
;
explicit $(src) ;
}
for local src in $(BOOST_LOG_COMMON_AVX2_SRC)
{
obj $(src)
: ## sources ##
$(src).cpp
: ## requirements ##
<conditional>@log-arch-config.avx2-flags
<link>shared:<define>BOOST_LOG_DLL
<define>BOOST_LOG_BUILDING_THE_LIB=1
: ## default-build ##
: ## usage-requirements ##
<define>BOOST_LOG_USE_AVX2
;
explicit $(src) ;
}
rule select-arch-specific-sources ( properties * )
{
local result ;
if <architecture>x86 in $(properties)
{
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/config/x86-ext//avx2 : $(properties) : "compiler supports AVX2" ] ;
if $(has_avx2)
{
result += <define>BOOST_LOG_USE_AVX2 ;
result += <source>$(BOOST_LOG_COMMON_AVX2_SRC) ;
}
}
# ECHO Arch sources: $(result) ;
return $(result) ;
}
rule select-platform-specific-sources ( properties * )
{
local result ;
if <target-os>windows in $(properties)
{
result += <source>windows/light_rw_mutex.cpp ;
result += <source>windows/is_debugger_present.cpp ;
if ! [ log-build-config.has-config-flag BOOST_LOG_WITHOUT_IPC : $(properties) ]
{
result += <source>windows/object_name.cpp ;
result += <source>windows/mapped_shared_memory.cpp ;
result += <source>windows/ipc_sync_wrappers.cpp ;
result += <source>windows/ipc_reliable_message_queue.cpp ;
result += <library>secur32 ;
}
if ! [ log-build-config.has-config-flag BOOST_LOG_WITHOUT_DEBUG_OUTPUT : $(properties) ]
{
result += <source>windows/debug_output_backend.cpp ;
}
if ! [ log-build-config.has-config-flag BOOST_LOG_WITHOUT_EVENT_LOG : $(properties) ]
{
result += <source>windows/simple_event_log.mc ;
result += <source>windows/event_log_backend.cpp ;
result += <library>psapi ;
DEPENDS windows/event_log_backend.cpp : windows/simple_event_log.mc ;
}
}
else
{
result += <define>BOOST_LOG_WITHOUT_EVENT_LOG ;
result += <define>BOOST_LOG_WITHOUT_DEBUG_OUTPUT ;
if ! [ log-build-config.has-config-flag BOOST_LOG_WITHOUT_IPC : $(properties) ]
{
result += <source>posix/object_name.cpp ;
result += <source>posix/ipc_reliable_message_queue.cpp ;
}
}
if ! [ log-build-config.has-config-flag BOOST_LOG_WITHOUT_SYSLOG : $(properties) ]
{
result += <source>syslog_backend.cpp ;
}
# ECHO Platform sources: $(result) ;
return $(result) ;
}
lib boost_log
: ## sources ##
$(BOOST_LOG_COMMON_SRC)
: ## requirements ##
<conditional>@select-arch-specific-sources
<conditional>@select-platform-specific-sources
<link>shared:<define>BOOST_LOG_DLL
<define>BOOST_LOG_BUILDING_THE_LIB=1
$(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
<define>BOOST_LOG_NO_LIB=1
$(boost_log_public_deps)
;
local BOOST_LOG_SETUP_COMMON_SRC =
parser_utils.cpp
init_from_stream.cpp
init_from_settings.cpp
settings_parser.cpp
filter_parser.cpp
formatter_parser.cpp
default_filter_factory.cpp
matches_relation_factory.cpp
default_formatter_factory.cpp
;
rule check-boost_log_setup-enabled ( properties * )
{
local result ;
if [ log-build-config.has-config-flag BOOST_LOG_WITHOUT_SETTINGS_PARSERS : $(properties) ]
{
result = <build>no ;
}
return $(result) ;
}
lib boost_log_setup
: ## sources ##
setup/$(BOOST_LOG_SETUP_COMMON_SRC)
: ## requirements ##
<conditional>@check-boost_log_setup-enabled
<link>shared:<define>BOOST_LOG_DYN_LINK=1
<link>shared:<define>BOOST_LOG_SETUP_DLL
<define>BOOST_LOG_SETUP_BUILDING_THE_LIB=1
$(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
<define>BOOST_LOG_SETUP_NO_LIB=1
$(boost_log_setup_public_deps)
;
alias boost_log_with_support
: requirements
$(boost_log_support_public_deps)
: usage-requirements
$(boost_log_support_public_deps)
;