forked from boostorg/predef
Sync from hash-predef.
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
# Copyright Rene Rivera 2015
|
# Copyright Rene Rivera 2015-2023
|
||||||
# Distributed under the Boost Software License, Version 1.0.
|
# Distributed under the Boost Software License, Version 1.0.
|
||||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
# http://www.boost.org/LICENSE_1_0.txt)
|
# http://www.boost.org/LICENSE_1_0.txt)
|
||||||
@ -31,6 +31,7 @@ rule check ( expressions + : language ? : true-properties * : false-properties *
|
|||||||
language ?= cpp ;
|
language ?= cpp ;
|
||||||
|
|
||||||
local project_target = [ project.target $(__name__) ] ;
|
local project_target = [ project.target $(__name__) ] ;
|
||||||
|
$(project_target).reset-alternatives ;
|
||||||
project.push-current $(project_target) ;
|
project.push-current $(project_target) ;
|
||||||
local terms ;
|
local terms ;
|
||||||
local result ;
|
local result ;
|
||||||
@ -69,6 +70,30 @@ rule require ( expressions + : language ? )
|
|||||||
return [ check $(expressions) : $(language) : : <build>no ] ;
|
return [ check $(expressions) : $(language) : : <build>no ] ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Set the address-model to the default/deduced value for the context.
|
||||||
|
rule address-model ( )
|
||||||
|
{
|
||||||
|
return
|
||||||
|
[ check "BOOST_ARCH_WORD_BITS == 0.0.16" : : <address-model>16 ]
|
||||||
|
[ check "BOOST_ARCH_WORD_BITS == 0.0.32" : : <address-model>32 ]
|
||||||
|
[ check "BOOST_ARCH_WORD_BITS == 0.0.64" : : <address-model>64 ]
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Set the architecture to the default/deduced value to the context.
|
||||||
|
rule architecture ( )
|
||||||
|
{
|
||||||
|
local result = ;
|
||||||
|
local deducable-arch =
|
||||||
|
x86 ia64 sparc ppc loongarch mips parisc arm riscv ;
|
||||||
|
for arch in $(deducable-arch)
|
||||||
|
{
|
||||||
|
result += [ check BOOST_ARCH_$(arch:U) : : <architecture>$(arch) ] ;
|
||||||
|
}
|
||||||
|
result += [ check BOOST_ARCH_SYS390 : : <architecture>s390x ] ;
|
||||||
|
return $(result) ;
|
||||||
|
}
|
||||||
|
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
.c.ext = c ;
|
.c.ext = c ;
|
||||||
@ -112,6 +137,7 @@ local rule change_term_to_def ( term )
|
|||||||
class check-expression-evaluator
|
class check-expression-evaluator
|
||||||
{
|
{
|
||||||
import configure ;
|
import configure ;
|
||||||
|
import property ;
|
||||||
|
|
||||||
rule __init__ ( expression + : true-properties * : false-properties * )
|
rule __init__ ( expression + : true-properties * : false-properties * )
|
||||||
{
|
{
|
||||||
@ -155,14 +181,22 @@ class check-expression-evaluator
|
|||||||
# Eval full the expression.
|
# Eval full the expression.
|
||||||
local eval-result = [ eval $(to-eval) ] ;
|
local eval-result = [ eval $(to-eval) ] ;
|
||||||
# And resolve true/false properties.
|
# And resolve true/false properties.
|
||||||
|
local result = ;
|
||||||
if $(eval-result) = "true"
|
if $(eval-result) = "true"
|
||||||
{
|
{
|
||||||
return $(self.true-properties) ;
|
result = $(self.true-properties) ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return $(self.false-properties) ;
|
result = $(self.false-properties) ;
|
||||||
}
|
}
|
||||||
|
if $(result)
|
||||||
|
{
|
||||||
|
# Don't override anything that is explicitly specified.
|
||||||
|
local base = [ property.select $(result:G) : $(properties) ] ;
|
||||||
|
result = [ property.refine $(result) : $(base) ] ;
|
||||||
|
}
|
||||||
|
return $(result) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
rule eval ( e * )
|
rule eval ( e * )
|
||||||
|
Reference in New Issue
Block a user