boostorg / boost

Super-project for modularized Boost
https://github.com/boostorg/wiki/wiki/Getting-Started%3A-Overview
Boost Software License 1.0
6.97k stars 1.72k forks source link

unified implict feature for platform deduction #898

Closed grisumbras closed 3 months ago

grisumbras commented 3 months ago

This changes separate deduction of address-model and architecture with a single x-deduced-platform (the corresponding rule is platform. The purpose of this is to shorten the target path, while keeping it unique for different configurations.

The logic of the conditional rule is this:

  1. If there's already x-deduced-platform in the property set, then return that (this is needed for repeated evaluation of conditionals).
  2. If eihter address-model or architecture could not be deduced, return nothing.
  3. Get address-model and architecture properties from the property set, assign deduced values to any if it is empty.
  4. Construct the corresponding value of x-deduced-platform. If there's no corresponfing value (e.g. user requested an architecture we don't support for deduction), return nothing.
  5. Otherwise return the constructed value.

The feature x-deduced-platform is composite. Due to that it subsumes properties that constitute it. Meaning, <address-model>32 <x-deduced-platform>x86 corresponds to the path x86 and not x86/address-model-32. Which is pretty neat.

The x- in the name x-deduced-platform is so that it sorts last.

grisumbras commented 3 months ago

Changed the feature to have values in the form X_32 and X_64. The change to underscore was because there's apparently special logic for hyphens in values of implicit features (presumably, for toolsets).