2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-18 01:52:17 +00:00
Files
build/src/tools/features/threadapi-feature.jam
Steven Watanabe ee613a6a28 Implement feature relevance.
* New feature <relevant> which is automatically deduced in most cases.
* Features which are not relevant do not affect target paths and
  do not prevent merging of virtual targets.
* generators.jam: generator.run always returns usage-requirements
  to allow usage-requirements in non-top-level generators.  This
  is necessary because we're using usage-requirements to track
  relevance from flags.
* New rule toolset.uses-features to specify features that the rule
  checks manually, instead of using toolset.flags.  In the future,
  we should consider restricting the properties actually passed,
  to detect errors.
* Adjust tests to handle the new paths (verified by inspection).
* Add temporary option --ignore-relevance to consider all features relevant
  to aid migration.
* New rule property.evaluate-conditional-relevance which helps tracking
  relevance in <conditional>.
* Widely scattered changes to use the new interfaces.
2018-01-13 09:13:49 -07:00

30 lines
775 B
Plaintext

# Copyright 2017 Alexander Karzhenkov
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
# TODO: Documentation.
import property-set ;
import feature : feature ;
if ! [ feature.valid threadapi ]
{
feature threadapi : win32 pthread : optional propagated ;
}
rule get-default ( property-set )
{
local api = pthread ;
if [ $(property-set).get <target-os> ] = windows { api = win32 ; }
return $(api) ;
}
rule detect ( properties * )
{
local ps = [ property-set.create $(properties) ] ;
local api = [ $(ps).get <threadapi> ] ;
if ! $(api) { api = [ get-default $(ps) ] ; }
return <threadapi>$(api) <relevant>threadapi:<relevant>target-os ;
}