2
0
mirror of https://github.com/boostorg/log.git synced 2026-01-19 04:22:09 +00:00
Files
log/build/log-arch-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

128 lines
3.2 KiB
Plaintext

# log-arch-config.jam
#
# Copyright 2012 Steven Watanabe
# Copyright 2013, 2020 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 deduce-address-model ( properties * )
{
# 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 * )
{
# 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) ] ;
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) ;
}
rule ssse3-flags ( properties * )
{
local result ;
if <toolset>intel in $(properties)
{
if <toolset-intel:platform>win in $(properties)
{
result = <cxxflags>"/QxSSSE3" ;
}
else
{
result = <cxxflags>"-xSSSE3" ;
}
}
else if <toolset>msvc in $(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 <address-model>32 in $(properties)
{
result = <cxxflags>"/arch:SSE2" ;
}
}
else
{
result = <cxxflags>"-msse -msse2 -msse3 -mssse3" ;
}
return $(result) ;
}
rule avx2-flags ( properties * )
{
local result ;
if <toolset>intel in $(properties)
{
if <toolset-intel:platform>win in $(properties)
{
result = <cxxflags>"/arch:CORE-AVX2" ;
}
else
{
result = <cxxflags>"-xCORE-AVX2 -fabi-version=0" ;
}
}
else if <toolset>msvc in $(properties)
{
result = <cxxflags>"/arch:AVX" ;
}
else if <toolset>clang in $(properties)
{
result = <cxxflags>"-mavx -mavx2" ;
}
else
{
result = <cxxflags>"-mavx -mavx2 -fabi-version=0" ;
}
return $(result) ;
}
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) ;
}