diff --git a/libs/thread/build/Jamfile.v2 b/libs/thread/build/Jamfile.v2 index eeed31d..7ac389a 100644 --- a/libs/thread/build/Jamfile.v2 +++ b/libs/thread/build/Jamfile.v2 @@ -37,6 +37,32 @@ import feature ; import indirect ; import path ; +feature.feature threadapi : pthread win32 : propagated ; + +rule set_default_threadapi ( properties * ) +{ + echo "set props" $(properties) ; + + local api = pthread ; + if windows in $(properties) { api = win32 ; } + if linux in $(properties) { api = pthread ; } + #if [ os.name ] = "NT" { api = win32 ; } + + return $(api) ; +} + +rule check_default_threadapi ( properties * ) +{ + echo "check props" $(properties) ; + + local api = pthread ; + if windows in $(properties) { api = win32 ; } + if linux in $(properties) { api = pthread ; } + #if [ os.name ] = "NT" { api = win32 ; } + + return $(api) ; +} + project boost/thread : source-location ../src : requirements multi @@ -106,6 +132,7 @@ project boost/thread intel:-wd1418 intel:-wd2415 + @check_default_threadapi # : default-build multi : usage-requirements # pass these requirement to dependents (i.e. users) @@ -118,15 +145,7 @@ project boost/thread /boost/system//boost_system ; -local rule default_threadapi ( ) -{ - local api = pthread ; - if [ os.name ] = "NT" { api = win32 ; } - return $(api) ; -} - -feature.feature threadapi : pthread win32 : propagated ; -feature.set-default threadapi : [ default_threadapi ] ; +feature.set-default threadapi : [ set_default_threadapi ] ; rule tag ( name : type ? : property-set ) { @@ -137,7 +156,7 @@ rule tag ( name : type ? : property-set ) local api = [ $(property-set).get ] ; # non native api gets additional tag - if $(api) != [ default_threadapi ] { + if $(api) != [ set_default_threadapi ] { result = $(result)_$(api) ; } }