diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 index 39c511b..9a294bf 100644 --- a/build/Jamfile.v2 +++ b/build/Jamfile.v2 @@ -9,6 +9,7 @@ require-b2 5.0.1 ; import-search /boost/config/checks ; import boost-stacktrace-features ; import config : requires ; +import configure ; import property ; constant boost_dependencies_private : @@ -63,9 +64,9 @@ explicit WinDbg ; mp-run-simple has_windbg_cached.cpp : : : Dbgeng ole32 : WinDbgCached ; explicit WinDbgCached ; -rule build-stacktrace-feature ( name : props * ) +rule build-stacktrace-noop ( props * ) { - local enabled = [ property.select : $(props) ] ; + local enabled = [ property.select : $(props) ] ; switch $(enabled:G=) { case "on" : return ; @@ -79,14 +80,28 @@ lib boost_stacktrace_noop : # requirements all shared:BOOST_STACKTRACE_DYN_LINK=1 - # Enable build when explicitly requested - @$(build-stacktrace-feature noop) + @build-stacktrace-noop : # default build : # usage-requirements #shared:BOOST_STACKTRACE_DYN_LINK=1 BOOST_STACKTRACE_NO_LIB=1 ; +rule build-stacktrace-backtrace ( props * ) +{ + local enabled = [ property.select : $(props) ] ; + switch $(enabled:G=) + { + case "on" : return ; + case "off" : return no ; + } + + if ! [ configure.builds libbacktrace : $(props) : "boost.stacktrace.backtrace" ] + { + return no ; + } +} + lib boost_stacktrace_backtrace : # sources ../src/backtrace.cpp @@ -95,8 +110,7 @@ lib boost_stacktrace_backtrace linux:dl backtrace shared:BOOST_STACKTRACE_DYN_LINK=1 - [ check-target-builds libbacktrace : : no ] - @$(build-stacktrace-feature backtrace) + @build-stacktrace-backtrace : # default build : # usage-requirements #shared:BOOST_STACKTRACE_DYN_LINK=1 @@ -114,6 +128,12 @@ rule build-stacktrace-addr2line ( props * ) # Disable by default on Windows when not using Cygwin if windows in $(props) && ! ( cygwin in $(props) ) + { + configure.log-library-search-result "boost.stacktrace.addr2line" : "no" ; + return no ; + } + + if ! [ configure.builds addr2line : $(props) : "boost.stacktrace.addr2line" ] { return no ; } @@ -126,7 +146,6 @@ lib boost_stacktrace_addr2line all linux:dl shared:BOOST_STACKTRACE_DYN_LINK=1 - [ check-target-builds addr2line : : no ] @build-stacktrace-addr2line : # default build : # usage-requirements @@ -134,6 +153,21 @@ lib boost_stacktrace_addr2line BOOST_STACKTRACE_NO_LIB=1 ; +rule build-stacktrace-basic ( props * ) +{ + local enabled = [ property.select : $(props) ] ; + switch $(enabled:G=) + { + case "on" : return ; + case "off" : return no ; + } + + if [ configure.builds WinDbg : $(props) : "boost.stacktrace.basic" ] + { + return no ; + } +} + lib boost_stacktrace_basic : # sources ../src/basic.cpp @@ -141,14 +175,28 @@ lib boost_stacktrace_basic all linux:dl shared:BOOST_STACKTRACE_DYN_LINK=1 - [ check-target-builds WinDbg : no ] - @$(build-stacktrace-feature basic) + @build-stacktrace-basic : # default build : # usage-requirements #shared:BOOST_STACKTRACE_DYN_LINK=1 BOOST_STACKTRACE_NO_LIB=1 ; +rule build-stacktrace-windbg ( props * ) +{ + local enabled = [ property.select : $(props) ] ; + switch $(enabled:G=) + { + case "on" : return ; + case "off" : return no ; + } + + if ! [ configure.builds WinDbg : $(props) : "boost.stacktrace.windbg" ] + { + return no ; + } +} + lib boost_stacktrace_windbg : # sources ../src/windbg.cpp @@ -156,14 +204,28 @@ lib boost_stacktrace_windbg all Dbgeng ole32 shared:BOOST_STACKTRACE_DYN_LINK=1 - [ check-target-builds WinDbg : : no ] - @$(build-stacktrace-feature windbg) + @build-stacktrace-windbg : # default build : # usage-requirements #shared:BOOST_STACKTRACE_DYN_LINK=1 BOOST_STACKTRACE_NO_LIB=1 ; +rule build-stacktrace-windbg-cached ( props * ) +{ + local enabled = [ property.select : $(props) ] ; + switch $(enabled:G=) + { + case "on" : return ; + case "off" : return no ; + } + + if ! [ configure.builds WinDbgCached : $(props) : "boost.stacktrace.windbg_cached" ] + { + return no ; + } +} + lib boost_stacktrace_windbg_cached : # sources ../src/windbg_cached.cpp @@ -171,8 +233,7 @@ lib boost_stacktrace_windbg_cached all Dbgeng ole32 shared:BOOST_STACKTRACE_DYN_LINK=1 - [ check-target-builds WinDbgCached : : no ] - @$(build-stacktrace-feature windbg-cached) + @build-stacktrace-windbg-cached : # default build : # usage-requirements #shared:BOOST_STACKTRACE_DYN_LINK=1 @@ -191,8 +252,10 @@ rule build-stacktrace-from-exception ( props * ) local arch = [ property.select : $(props) ] ; if $(arch) && ( $(arch:G=) != x86 ) { + configure.log-library-search-result "boost.stacktrace.from_exception" : "no" ; return no ; } + configure.log-library-search-result "boost.stacktrace.from_exception" : "yes" ; } lib boost_stacktrace_from_exception @@ -204,9 +267,6 @@ lib boost_stacktrace_from_exception # Enable build when explicitly requested, or by default, when on x86 @build-stacktrace-from-exception - - # Require usable libbacktrace on other platforms - # [ check-target-builds libbacktrace : : no ] : # default build : # usage-requirements #shared:BOOST_STACKTRACE_DYN_LINK=1