Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix deduction not properly working #894

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 10 additions & 39 deletions boostcpp.jam
Original file line number Diff line number Diff line change
Expand Up @@ -606,49 +606,29 @@ rule toolset-properties ( properties * )
return [ property.select <target-os> <toolset> $(toolset-version-property) : $(properties) ] ;
}

feature.feature deduced-address-model : 32 64 : propagated optional composite hidden ;
feature.compose <deduced-address-model>32 : <address-model>32 ;
feature.compose <deduced-address-model>64 : <address-model>64 ;

rule deduce-address-model ( properties * )
{
local result ;
local deduced ;
local filtered = [ toolset-properties $(properties) ] ;
local names = 32 64 ;
local idx = [ configure.find-builds "default address-model" : $(filtered)
: /boost/architecture//32 "32-bit"
: /boost/architecture//64 "64-bit" ] ;
result = $(names[$(idx)]) ;

local am = [ property.select <address-model> : $(properties) ] ;
if ! $(am)
{
return <deduced-address-model>$(result) ;
}
deduced = $(names[$(idx)]) ;

if $(am:G=) = $(result)
{
return <deduced-address-model>$(result) $(am) ;
}

return ;
local result = [ property.select <address-model> : $(properties) ] ;
result ?= <address-model>$(deduced) ;
return $(result) ;
}

rule address-model ( )
{
return <conditional>@boostcpp.deduce-address-model ;
}

local deducable-architectures = arm loongarch mips power riscv s390x sparc x86 combined ;
feature.feature deduced-architecture : $(deducable-architectures) : propagated optional composite hidden ;
for a in $(deducable-architectures)
{
feature.compose <deduced-architecture>$(a) : <architecture>$(a) ;
}

rule deduce-architecture ( properties * )
{
local result ;
local deduced ;
local filtered = [ toolset-properties $(properties) ] ;
local names = arm loongarch mips power riscv s390x sparc x86 combined ;
local idx = [ configure.find-builds "default architecture" : $(filtered)
Expand All @@ -661,20 +641,11 @@ rule deduce-architecture ( properties * )
: /boost/architecture//sparc
: /boost/architecture//x86
: /boost/architecture//combined ] ;
result = $(names[$(idx)]) ;

local arch = [ property.select <architecture> : $(properties) ] ;
if ! $(arch)
{
return <deduced-architecture>$(result) ;
}

if $(arch:G=) = $(result)
{
return <deduced-architecture>$(result) $(arch) ;
}
deduced = $(names[$(idx)]) ;

return ;
local result = [ property.select <architecture> : $(properties) ] ;
result ?= <architecture>$(deduced) ;
return $(result) ;
}

rule architecture ( )
Expand Down