mirror of
https://github.com/boostorg/atomic.git
synced 2026-01-19 04:02:09 +00:00
* Make the library modular usable. * Switch to library requirements instead of source. As source puts extra source in install targets. * Add missing NO_LIB usage requirements. * 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. * Split b2 dependencies into public and private. * Be explicit about the kind of public dependencies and make the winapi be conditional on windows target-os.
128 lines
3.3 KiB
Plaintext
128 lines
3.3 KiB
Plaintext
#
|
|
# Copyright Andrey Semashev 2020.
|
|
# 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)
|
|
#
|
|
# This jamfile contains utility rules to select architecture-specific compiler flags
|
|
|
|
import common ;
|
|
import feature ;
|
|
import configure ;
|
|
|
|
rule deduce-architecture ( properties * )
|
|
{
|
|
local architecture = [ feature.get-values "architecture" : $(properties) ] ;
|
|
if $(architecture)
|
|
{
|
|
return $(architecture) ;
|
|
}
|
|
else
|
|
{
|
|
if [ configure.builds /boost/config/checks/architecture//x86 : $(properties) : "x86" ]
|
|
{
|
|
return x86 ;
|
|
}
|
|
else if [ configure.builds /boost/config/checks/architecture//arm : $(properties) : "arm" ]
|
|
{
|
|
return arm ;
|
|
}
|
|
else if [ configure.builds /boost/config/checks/architecture//mips1 : $(properties) : "mips1" ]
|
|
{
|
|
return mips1 ;
|
|
}
|
|
else if [ configure.builds /boost/config/checks/architecture//power : $(properties) : "power" ]
|
|
{
|
|
return power ;
|
|
}
|
|
else if [ configure.builds /boost/config/checks/architecture//sparc : $(properties) : "sparc" ]
|
|
{
|
|
return sparc ;
|
|
}
|
|
}
|
|
}
|
|
|
|
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/config/checks/architecture//32 : $(properties) : "32-bit" ]
|
|
{
|
|
return 32 ;
|
|
}
|
|
else if [ configure.builds /boost/config/checks/architecture//64 : $(properties) : "64-bit" ]
|
|
{
|
|
return 64 ;
|
|
}
|
|
}
|
|
}
|
|
|
|
rule sse2-flags ( properties * )
|
|
{
|
|
local result ;
|
|
|
|
if <toolset>intel in $(properties)
|
|
{
|
|
if <toolset-intel:platform>win in $(properties)
|
|
{
|
|
result = <cxxflags>"/QxSSE2" ;
|
|
}
|
|
else
|
|
{
|
|
result = <cxxflags>"-xSSE2" ;
|
|
}
|
|
}
|
|
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 32 in [ deduce-address-model $(properties) ]
|
|
{
|
|
result = <cxxflags>"/arch:SSE2" ;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
result = <cxxflags>"-msse -msse2" ;
|
|
}
|
|
|
|
return $(result) ;
|
|
}
|
|
|
|
rule sse41-flags ( properties * )
|
|
{
|
|
local result ;
|
|
|
|
if <toolset>intel in $(properties)
|
|
{
|
|
if <toolset-intel:platform>win in $(properties)
|
|
{
|
|
result = <cxxflags>"/QxSSE4.1" ;
|
|
}
|
|
else
|
|
{
|
|
result = <cxxflags>"-xSSE4.1" ;
|
|
}
|
|
}
|
|
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 32 in [ deduce-address-model $(properties) ]
|
|
{
|
|
result = <cxxflags>"/arch:SSE2" ;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
result = <cxxflags>"-msse -msse2 -msse3 -mssse3 -msse4.1" ;
|
|
}
|
|
|
|
return $(result) ;
|
|
}
|