@@ -11,6 +11,12 @@ import boost-stacktrace-features ;
11
11
import config : requires ;
12
12
import property ;
13
13
14
+ constant stacktrace_common_requirements :
15
+ <warnings>all
16
+ <link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
17
+ <define>BOOST_STACKTRACE_NO_LIB=1
18
+ ;
19
+
14
20
constant boost_dependencies_private :
15
21
<library>/boost/assert//boost_assert
16
22
;
@@ -63,87 +69,108 @@ explicit WinDbg ;
63
69
mp-run-simple has_windbg_cached.cpp : : : <library>Dbgeng <library>ole32 : WinDbgCached ;
64
70
explicit WinDbgCached ;
65
71
72
+ rule build-stacktrace-feature ( name : props * )
73
+ {
74
+ local enabled = [ property.select <boost.stacktrace.$(name)> : $(props) ] ;
75
+ switch $(enabled:G=)
76
+ {
77
+ case "on" : return ;
78
+ case "off" : return <build>no ;
79
+ }
80
+ }
81
+
66
82
lib boost_stacktrace_noop
67
83
: # sources
68
84
../src/noop.cpp
69
85
: # requirements
70
- <warnings>all
71
- <link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
86
+ $(stacktrace_common_requirements)
87
+ # Enable build when explicitly requested
88
+ <conditional>@$(build-stacktrace-feature noop)
72
89
: # default build
73
90
: # usage-requirements
74
91
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
75
- <define>BOOST_STACKTRACE_NO_LIB=1
76
92
;
77
93
78
94
lib boost_stacktrace_backtrace
79
95
: # sources
80
96
../src/backtrace.cpp
81
97
: # requirements
82
- <warnings>all
98
+ $(stacktrace_common_requirements)
83
99
<target-os>linux:<library>dl
84
100
<library>backtrace
85
- <link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
86
101
[ check-target-builds libbacktrace : : <build>no ]
102
+ <conditional>@$(build-stacktrace-feature backtrace)
87
103
: # default build
88
104
: # usage-requirements
89
105
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
90
- <define>BOOST_STACKTRACE_NO_LIB=1
91
106
;
92
107
108
+ rule build-stacktrace-addr2line ( props * )
109
+ {
110
+ local enabled = [ property.select <boost.stacktrace.addr2line> : $(props) ] ;
111
+ switch $(enabled:G=)
112
+ {
113
+ case "on" : return ;
114
+ case "off" : return <build>no ;
115
+ }
116
+
117
+ # Disable by default on Windows when not using Cygwin
118
+ if <target-os>windows in $(props) && ! ( <target-os>cygwin in $(props) )
119
+ {
120
+ return <build>no ;
121
+ }
122
+ }
123
+
93
124
lib boost_stacktrace_addr2line
94
125
: # sources
95
126
../src/addr2line.cpp
96
127
: # requirements
97
- <warnings>all
128
+ $(stacktrace_common_requirements)
98
129
<target-os>linux:<library>dl
99
- <link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
100
130
[ check-target-builds addr2line : : <build>no ]
131
+ <conditional>@build-stacktrace-addr2line
101
132
: # default build
102
133
: # usage-requirements
103
134
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
104
- <define>BOOST_STACKTRACE_NO_LIB=1
105
135
;
106
136
107
137
lib boost_stacktrace_basic
108
138
: # sources
109
139
../src/basic.cpp
110
140
: # requirements
111
- <warnings>all
141
+ $(stacktrace_common_requirements)
112
142
<target-os>linux:<library>dl
113
- <link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
114
143
[ check-target-builds WinDbg : <build>no ]
144
+ <conditional>@$(build-stacktrace-feature basic)
115
145
: # default build
116
146
: # usage-requirements
117
147
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
118
- <define>BOOST_STACKTRACE_NO_LIB=1
119
148
;
120
149
121
150
lib boost_stacktrace_windbg
122
151
: # sources
123
152
../src/windbg.cpp
124
153
: # requirements
125
- <warnings>all
154
+ $(stacktrace_common_requirements)
126
155
<library>Dbgeng <library>ole32
127
- <link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
128
156
[ check-target-builds WinDbg : : <build>no ]
157
+ <conditional>@$(build-stacktrace-feature windbg)
129
158
: # default build
130
159
: # usage-requirements
131
160
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
132
- <define>BOOST_STACKTRACE_NO_LIB=1
133
161
;
134
162
135
163
lib boost_stacktrace_windbg_cached
136
164
: # sources
137
165
../src/windbg_cached.cpp
138
166
: # requirements
139
- <warnings>all
167
+ $(stacktrace_common_requirements)
140
168
<library>Dbgeng <library>ole32
141
- <link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
142
169
[ check-target-builds WinDbgCached : : <build>no ]
170
+ <conditional>@$(build-stacktrace-feature windbg-cached)
143
171
: # default build
144
172
: # usage-requirements
145
173
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
146
- <define>BOOST_STACKTRACE_NO_LIB=1
147
174
;
148
175
149
176
rule build-stacktrace-from-exception ( props * )
@@ -166,7 +193,7 @@ lib boost_stacktrace_from_exception
166
193
: # sources
167
194
../src/from_exception.cpp
168
195
: # requirements
169
- <warnings>all
196
+ $(stacktrace_common_requirements)
170
197
<target-os>linux:<library>dl
171
198
172
199
# Enable build when explicitly requested, or by default, when on x86
@@ -177,5 +204,4 @@ lib boost_stacktrace_from_exception
177
204
: # default build
178
205
: # usage-requirements
179
206
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
180
- <define>BOOST_STACKTRACE_NO_LIB=1
181
207
;
0 commit comments