Changes between Version 4 and Version 5 of AlternativeSelection


Ignore:
Timestamp:
Mar 26, 2007, 4:11:21 AM (19 years ago)
Author:
Dave Abrahams
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AlternativeSelection

    v4 v5  
    3434My claim is that it would be more appropriate to build the 2nd alternative because it is a better match for the explicit build request.
    3535
    36 Boost.Build generates an error because the default value of the {{{<profiling>}}} feature is {{{off}}}.  It combines that default value with the explicit build request to get {{{<debug-symbols>on <profiling>off}}}, which does not match the 2nd alternative.
     36Boost.Build generates an error because the default value of the {{{<profiling>}}} feature is "{{{off}}}".  Boost.Build combines that default value with the explicit build request to get {{{<debug-symbols>on <profiling>off}}}, which does not match the 2nd alternative.
     37
     38==== Consistency ====
     39
     40I know at this point you're probably saying "that makes sense; you asked for something for which there's no alternative with matching requirements."  However, "no matching requirements" is currently ''not'' an error when there's only one alternative declared:
     41
     42{{{
     43lib b : b.cpp : <debug-symbols>off ;
     44lib c : c.cpp : <debug-symbols>on <profiling>on ;
     45}}}
     46
     47in this case, {{{bjam debug-symbols=on}}} happily builds both {{{b}}} (with debug-symbols off) and {{{c}}} (with profiling on) despite the fact that the requirements for {{{b}}} directly contradict the explicit build request and that the default for {{{profiling}}}, which is added to the build request, contradicts the requirements for {{{c}}}.
     48
     49Indeed, the error message didn't say "there's no matching alternative;" it said there's "no ''best'' alternative."  This proposal turns on how we define "best."