From 166158defa0f666643560f2657775bab04744be9 Mon Sep 17 00:00:00 2001 From: Dmitry Arkhipov Date: Mon, 29 Apr 2024 08:35:50 +0300 Subject: [PATCH] fix deduction not properly working --- boostcpp.jam | 49 ++++++++++--------------------------------------- 1 file changed, 10 insertions(+), 39 deletions(-) diff --git a/boostcpp.jam b/boostcpp.jam index 91eda62e8972..a46e21caaab9 100644 --- a/boostcpp.jam +++ b/boostcpp.jam @@ -606,32 +606,19 @@ rule toolset-properties ( properties * ) return [ property.select $(toolset-version-property) : $(properties) ] ; } -feature.feature deduced-address-model : 32 64 : propagated optional composite hidden ; -feature.compose 32 : 32 ; -feature.compose 64 : 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 : $(properties) ] ; - if ! $(am) - { - return $(result) ; - } + deduced = $(names[$(idx)]) ; - if $(am:G=) = $(result) - { - return $(result) $(am) ; - } - - return ; + local result = [ property.select : $(properties) ] ; + result ?= $(deduced) ; + return $(result) ; } rule address-model ( ) @@ -639,16 +626,9 @@ rule address-model ( ) return @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 $(a) : $(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) @@ -661,20 +641,11 @@ rule deduce-architecture ( properties * ) : /boost/architecture//sparc : /boost/architecture//x86 : /boost/architecture//combined ] ; - result = $(names[$(idx)]) ; - - local arch = [ property.select : $(properties) ] ; - if ! $(arch) - { - return $(result) ; - } - - if $(arch:G=) = $(result) - { - return $(result) $(arch) ; - } + deduced = $(names[$(idx)]) ; - return ; + local result = [ property.select : $(properties) ] ; + result ?= $(deduced) ; + return $(result) ; } rule architecture ( )