2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-16 13:22:11 +00:00
Files
build/src/tools/features/threadapi-feature.jam
Dmitry b54f53ccbc Document features (#498)
* move feature documentation into each feature's source file

* sort features in the docs

* updated docs for features
2019-10-28 07:22:42 -05:00

40 lines
1.1 KiB
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)
import property-set ;
import feature : feature ;
import toolset ;
import features/os-feature ;
#| tag::doc[]
[[bbv2.builtin.features.threadapi]]`threadapi`::
*Allowed values:* `pthread`, `win32`.
+
Selects threading implementation. The default is `win32` if `<target-os>` is
`windows` and `pthread` otherwise.
|# # end::doc[]
feature threadapi : pthread win32 : symmetric propagated ;
toolset.add-defaults <target-os>windows:<threadapi>win32 ;
rule get-default ( property-set )
{
local api = pthread ;
if [ $(property-set).get <target-os> ] = windows { api = win32 ; }
return $(api) ;
}
# Obsolete rule that didn't quite work. Remove this
# after all references to it have been cleaned up.
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 ;
}