# 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 ] = windows { api = win32 ; } return $(api) ; } rule detect ( properties * ) { local ps = [ property-set.create $(properties) ] ; local api = [ $(ps).get ] ; if ! $(api) { api = [ get-default $(ps) ] ; } return $(api) threadapi:target-os ; }