Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 24 additions & 7 deletions boost-context-features.jam
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import feature ;
import os ;
import property ;

feature.feature segmented-stacks : on : optional propagated composite ;
feature.compose <segmented-stacks>on : <define>BOOST_USE_SEGMENTED_STACKS ;
Expand All @@ -15,14 +16,30 @@ feature.compose <htm>tsx : <define>BOOST_USE_TSX ;
feature.feature valgrind : on : optional propagated composite ;
feature.compose <valgrind>on : <define>BOOST_USE_VALGRIND ;

local rule default_binary_format ( )
rule default_binary_format ( properties * )
{
local tmp = elf ;
if [ os.name ] = "NT" { tmp = pe ; }
else if [ os.name ] = "CYGWIN" { tmp = pe ; }
else if [ os.name ] = "AIX" { tmp = xcoff ; }
else if [ os.name ] = "MACOSX" { tmp = mach-o ; }
return $(tmp) ;
local target-os = [ property.select <target-os> : $(properties) ] ;

if $(target-os)
{
if <target-os>windows in $(properties) { tmp = pe ; }
else if <target-os>cygwin in $(properties) { tmp = pe ; }
else if <target-os>aix in $(properties) { tmp = xcoff ; }
else if <target-os>darwin in $(properties) { tmp = mach-o ; }
else if <target-os>iphone in $(properties) { tmp = mach-o ; }
else if <target-os>appletv in $(properties) { tmp = mach-o ; }
else if <target-os>watchos in $(properties) { tmp = mach-o ; }
# else: android, linux, freebsd, solaris, qnx, vxworks, ... -> elf
}
else
{
if [ os.name ] = "NT" { tmp = pe ; }
else if [ os.name ] = "CYGWIN" { tmp = pe ; }
else if [ os.name ] = "AIX" { tmp = xcoff ; }
else if [ os.name ] = "MACOSX" { tmp = mach-o ; }
}
return <binary-format>$(tmp) ;
}

feature.feature binary-format
Expand All @@ -32,7 +49,7 @@ feature.feature binary-format
xcoff
: propagated
;
feature.set-default binary-format : [ default_binary_format ] ;
feature.set-default binary-format : elf ;

local rule default_abi ( )
{
Expand Down
2 changes: 2 additions & 0 deletions build/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ import modules ;
import os ;
import toolset ;
import config : requires ;
import boost-context-features ;

project
: common-requirements <library>$(boost_dependencies)
: requirements
<conditional>@boost-context-features.default_binary_format
<target-os>windows,<architecture>arm,<address-model>64:<context-impl>winfib
<target-os>windows:<define>_WIN32_WINNT=0x0601
<target-os>linux,<toolset>gcc,<segmented-stacks>on:<cxxflags>-fsplit-stack
Expand Down