]>
Commit | Line | Data |
---|---|---|
11fdf7f2 | 1 | # Copyright (C) 2016-2018, Antony Polukhin. |
b32b8144 FG |
2 | # |
3 | # Use, modification and distribution is subject to the Boost Software License, | |
4 | # Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at | |
5 | # http://www.boost.org/LICENSE_1_0.txt) | |
6 | # | |
7 | ||
8 | lib dl : : <link>shared ; | |
9 | lib gcc_s ; | |
10 | lib rt ; | |
11 | lib Dbgeng ; | |
12 | lib ole32 ; | |
13 | ||
14 | local LIBBACKTRACE_PATH = [ modules.peek : LIBBACKTRACE_PATH ] ; | |
15 | lib backtrace | |
16 | : | |
17 | : <search>$(LIBBACKTRACE_PATH)/lib <link>static | |
18 | : | |
19 | : <include>$(LIBBACKTRACE_PATH)/include | |
20 | ; | |
21 | ||
22 | ||
23 | project | |
24 | : requirements | |
25 | <toolset>msvc:<asynch-exceptions>on | |
26 | <toolset>intel:<cxxflags>-wd2196 | |
11fdf7f2 | 27 | <target-os>linux:<linkflags>-lpthread |
b32b8144 FG |
28 | <warnings>all |
29 | <test-info>always_show_run_output | |
30 | ; | |
31 | ||
32 | local RDYNAMIC = <target-os>freebsd:<linkflags>"-rdynamic" <target-os>solaris:<linkflags>"-Bdynamic" <target-os>aix:<linkflags>"-rdynamic" | |
33 | <target-os>qnxnto,<toolset>qcc:<linkflags>"-Bdynamic" <target-os>qnxnto,<toolset>gcc:<linkflags>"-rdynamic" | |
34 | <target-os>android:<linkflags>"-rdynamic" <target-os>linux:<linkflags>"-rdynamic" <target-os>darwin,<toolset>gcc:<linkflags>"-dynamic" | |
35 | <target-os>darwin,<toolset>clang:<linkflags>"-rdynamic" <target-os>iphone:<linkflags>"-rdynamic" ; | |
36 | ||
37 | local HIDE_SYMBS = <target-os>linux:<cxxflags>"-fvisibility=hidden" ; | |
38 | ||
39 | local BT_DEPS = $(HIDE_SYMBS) <target-os>linux:<library>dl <library>backtrace [ check-target-builds ../build//libbacktrace : : <build>no ] ; | |
40 | local AD2L_DEPS = $(HIDE_SYMBS) <target-os>linux:<library>dl [ check-target-builds ../build//addr2line : : <build>no ] ; | |
41 | local WIND_DEPS = $(HIDE_SYMBS) <library>Dbgeng <library>ole32 [ check-target-builds ../build//WinDbg : : <build>no ] ; | |
42 | local WICA_DEPS = $(HIDE_SYMBS) <library>Dbgeng <library>ole32 [ check-target-builds ../build//WinDbgCached : : <build>no ] ; | |
43 | local NOOP_DEPS = $(HIDE_SYMBS) ; | |
44 | local BASIC_DEPS = $(RDYNAMIC) <target-os>linux:<library>dl [ check-target-builds ../build//WinDbg : <build>no ] ; | |
45 | ||
46 | local LINKSHARED_BT = <link>shared <define>BOOST_STACKTRACE_DYN_LINK <library>/boost/stacktrace//boost_stacktrace_backtrace $(BT_DEPS) ; | |
47 | local LINKSHARED_AD2L = <link>shared <define>BOOST_STACKTRACE_DYN_LINK <library>/boost/stacktrace//boost_stacktrace_addr2line $(AD2L_DEPS) ; | |
48 | local LINKSHARED_WIND = <link>shared <define>BOOST_STACKTRACE_DYN_LINK <library>/boost/stacktrace//boost_stacktrace_windbg $(WIND_DEPS) ; | |
49 | local LINKSHARED_WIND_CACHED = <link>shared <define>BOOST_STACKTRACE_DYN_LINK <library>/boost/stacktrace//boost_stacktrace_windbg_cached $(WICA_DEPS) ; | |
50 | local LINKSHARED_NOOP = <link>shared <define>BOOST_STACKTRACE_DYN_LINK <library>/boost/stacktrace//boost_stacktrace_noop $(NOOP_DEPS) ; | |
51 | local LINKSHARED_BASIC = <link>shared <define>BOOST_STACKTRACE_DYN_LINK <library>/boost/stacktrace//boost_stacktrace_basic $(BASIC_DEPS) ; | |
52 | ||
53 | # Libs with debug symbols | |
54 | lib test_impl_lib_backtrace : test_impl.cpp : <debug-symbols>on $(LINKSHARED_BT) ; | |
55 | lib test_impl_lib_addr2line : test_impl.cpp : <debug-symbols>on $(LINKSHARED_AD2L) ; | |
56 | lib test_impl_lib_windbg : test_impl.cpp : <debug-symbols>on $(LINKSHARED_WIND) ; | |
57 | lib test_impl_lib_windbg_cached : test_impl.cpp : <debug-symbols>on $(LINKSHARED_WIND_CACHED) ; | |
58 | lib test_impl_lib_noop : test_impl.cpp : <debug-symbols>on $(LINKSHARED_NOOP) ; | |
59 | ||
60 | obj test_impl_nohide-obj : test_impl.cpp : <debug-symbols>on $(LINKSHARED_BASIC) ; | |
61 | lib test_impl_lib_basic : test_impl_nohide-obj : <debug-symbols>on $(LINKSHARED_BASIC) ; | |
62 | ||
63 | ||
64 | # Libs without debug symbols | |
65 | lib test_impl_lib_backtrace_no_dbg : test_impl.cpp : <debug-symbols>off $(LINKSHARED_BT) ; | |
66 | lib test_impl_lib_addr2line_no_dbg : test_impl.cpp : <debug-symbols>off $(LINKSHARED_AD2L) ; | |
67 | lib test_impl_lib_windbg_no_dbg : test_impl.cpp : <debug-symbols>off $(LINKSHARED_WIND) ; | |
68 | lib test_impl_lib_windbg_cached_no_dbg : test_impl.cpp : <debug-symbols>off $(LINKSHARED_WIND_CACHED) ; | |
69 | lib test_impl_lib_noop_no_dbg : test_impl.cpp : <debug-symbols>off $(LINKSHARED_NOOP) ; | |
70 | ||
71 | obj test_impl_nohide_no_dbg-obj : test_impl.cpp : <debug-symbols>off $(LINKSHARED_BASIC) ; | |
72 | lib test_impl_lib_basic_no_dbg : test_impl_nohide_no_dbg-obj : <debug-symbols>off $(LINKSHARED_BASIC) ; | |
73 | ||
74 | ||
75 | test-suite stacktrace_tests | |
76 | : | |
77 | ||
78 | # Header only tests with debug symbols | |
79 | [ run test.cpp test_impl.cpp : : : <debug-symbols>on <define>BOOST_STACKTRACE_USE_BACKTRACE $(BT_DEPS) : backtrace_ho ] | |
80 | [ run test.cpp test_impl.cpp : : : <debug-symbols>on <define>BOOST_STACKTRACE_USE_ADDR2LINE $(AD2L_DEPS) : addr2line_ho ] | |
81 | [ run test_noop.cpp test_impl.cpp : : : <debug-symbols>on <define>BOOST_STACKTRACE_USE_NOOP $(NOOP_DEPS) : noop_ho ] | |
82 | [ run test.cpp test_impl.cpp : : : <debug-symbols>on $(WIND_DEPS) : windbg_ho ] | |
83 | [ run test.cpp test_impl.cpp : : : <debug-symbols>on <define>BOOST_STACKTRACE_USE_WINDBG_CACHED $(WICA_DEPS) : windbg_cached_ho ] | |
84 | [ run test.cpp test_impl.cpp : : : <debug-symbols>on $(BASIC_DEPS) : basic_ho ] | |
85 | ||
86 | # Test with shared linked implementations with debug symbols | |
87 | [ run test.cpp : : : <debug-symbols>on <library>.//test_impl_lib_backtrace $(LINKSHARED_BT) : backtrace_lib ] | |
88 | [ run test.cpp : : : <debug-symbols>on <library>.//test_impl_lib_addr2line $(LINKSHARED_AD2L) : addr2line_lib ] | |
89 | [ run test.cpp : : : <debug-symbols>on <library>.//test_impl_lib_windbg $(LINKSHARED_WIND) : windbg_lib ] | |
90 | [ run test.cpp : : : <debug-symbols>on <library>.//test_impl_lib_windbg_cached $(LINKSHARED_WIND_CACHED) : windbg_cached_lib ] | |
91 | [ run test_noop.cpp : : : <debug-symbols>on <library>.//test_impl_lib_noop $(LINKSHARED_NOOP) : noop_lib ] | |
92 | [ run test.cpp : : : <debug-symbols>on <library>.//test_impl_lib_basic $(LINKSHARED_BASIC) : basic_lib ] | |
93 | ||
94 | # Thread safety with debug symbols | |
95 | [ run thread_safety_checking.cpp | |
96 | : : : <debug-symbols>on <library>/boost/thread//boost_thread <library>/boost/timer//boost_timer <library>.//test_impl_lib_backtrace $(LINKSHARED_BT) | |
97 | : backtrace_lib_threaded ] | |
98 | [ run thread_safety_checking.cpp | |
99 | : : : <debug-symbols>on <library>/boost/thread//boost_thread <library>/boost/timer//boost_timer <library>.//test_impl_lib_windbg $(LINKSHARED_WIND) | |
100 | : windbg_lib_threaded ] | |
101 | [ run thread_safety_checking.cpp | |
102 | : : : <debug-symbols>on <library>/boost/thread//boost_thread <library>/boost/timer//boost_timer <library>.//test_impl_lib_windbg_cached $(LINKSHARED_WIND_CACHED) | |
103 | : windbg_cached_lib_threaded ] | |
104 | [ run thread_safety_checking.cpp | |
105 | : : : <debug-symbols>on <library>/boost/thread//boost_thread <library>/boost/timer//boost_timer <library>.//test_impl_lib_basic $(LINKSHARED_BASIC) | |
106 | : basic_lib_threaded ] | |
107 | ||
108 | [ run thread_safety_checking.cpp | |
109 | : : : <debug-symbols>on <library>/boost/thread//boost_thread <library>/boost/timer//boost_timer <library>.//test_impl_lib_windbg | |
110 | $(LINKSHARED_WIND) <define>BOOST_STACKTRACE_TEST_COM_PREINIT_MT | |
111 | : windbg_lib_threaded_com_mt ] | |
112 | [ run thread_safety_checking.cpp | |
113 | : : : <debug-symbols>on <library>/boost/thread//boost_thread <library>/boost/timer//boost_timer <library>.//test_impl_lib_windbg_cached | |
114 | $(LINKSHARED_WIND_CACHED) <define>BOOST_STACKTRACE_TEST_COM_PREINIT_ST | |
115 | : windbg_cached_lib_threaded_com_st ] | |
116 | ||
117 | ##### Tests with disabled debug symbols ##### | |
118 | ||
119 | # Header only tests without debug symbols | |
120 | [ run test.cpp test_impl.cpp : : : <debug-symbols>off <define>BOOST_STACKTRACE_USE_BACKTRACE <define>BOOST_STACKTRACE_TEST_NO_DEBUG_AT_ALL $(BT_DEPS) : backtrace_ho_no_dbg ] | |
121 | [ run test_noop.cpp test_impl.cpp : : : <debug-symbols>off <define>BOOST_STACKTRACE_USE_NOOP $(NOOP_DEPS) : noop_ho_no_dbg ] | |
122 | [ run test.cpp test_impl.cpp : : : <debug-symbols>off <define>BOOST_STACKTRACE_TEST_NO_DEBUG_AT_ALL $(WIND_DEPS) : windbg_ho_no_dbg ] | |
123 | [ run test.cpp test_impl.cpp : : : <debug-symbols>off <define>BOOST_STACKTRACE_USE_WINDBG_CACHED <define>BOOST_STACKTRACE_TEST_NO_DEBUG_AT_ALL $(WICA_DEPS) : windbg_cached_ho_no_dbg ] | |
124 | [ run test.cpp test_impl.cpp : : : <debug-symbols>off $(BASIC_DEPS) : basic_ho_no_dbg ] | |
125 | [ run test.cpp test_impl.cpp | |
126 | : : : <debug-symbols>off <define>BOOST_STACKTRACE_USE_ADDR2LINE <define>BOOST_STACKTRACE_ADDR2LINE_LOCATION="/usr/bin/addr2line" $(AD2L_DEPS) | |
127 | : addr2line_ho_no_dbg ] | |
128 | ||
129 | # Test with shared linked implementations without debug symbols | |
130 | [ run test.cpp : : : <debug-symbols>off <library>.//test_impl_lib_backtrace_no_dbg $(LINKSHARED_BT) <define>BOOST_STACKTRACE_TEST_NO_DEBUG_AT_ALL : backtrace_lib_no_dbg ] | |
131 | [ run test.cpp : : : <debug-symbols>off <library>.//test_impl_lib_addr2line_no_dbg $(LINKSHARED_AD2L) : addr2line_lib_no_dbg ] | |
132 | [ run test.cpp : : : <debug-symbols>off <library>.//test_impl_lib_windbg_no_dbg $(LINKSHARED_WIND) <define>BOOST_STACKTRACE_TEST_NO_DEBUG_AT_ALL : windbg_lib_no_dbg ] | |
133 | [ run test.cpp : : : <debug-symbols>off <library>.//test_impl_lib_windbg_cached_no_dbg $(LINKSHARED_WIND_CACHED) <define>BOOST_STACKTRACE_TEST_NO_DEBUG_AT_ALL : windbg_cached_lib_no_dbg ] | |
134 | [ run test_noop.cpp : : : <debug-symbols>off <library>.//test_impl_lib_noop_no_dbg $(LINKSHARED_NOOP) : noop_lib_no_dbg ] | |
135 | [ run test.cpp : : : <debug-symbols>off <library>.//test_impl_lib_basic_no_dbg $(LINKSHARED_BASIC) : basic_lib_no_dbg ] | |
136 | ||
137 | # Thread safety without debug symbols | |
138 | [ run thread_safety_checking.cpp | |
11fdf7f2 TL |
139 | : : : <debug-symbols>off |
140 | <library>/boost/thread//boost_thread | |
141 | <library>/boost/timer//boost_timer | |
142 | <library>.//test_impl_lib_backtrace_no_dbg | |
143 | $(LINKSHARED_BT) | |
b32b8144 FG |
144 | : backtrace_lib_no_dbg_threaded ] |
145 | [ run thread_safety_checking.cpp | |
11fdf7f2 TL |
146 | : : : <debug-symbols>off |
147 | <library>/boost/thread//boost_thread | |
148 | <library>/boost/timer//boost_timer | |
149 | <library>.//test_impl_lib_windbg_no_dbg | |
150 | $(LINKSHARED_WIND) | |
b32b8144 FG |
151 | : windbg_lib_no_dbg_threaded ] |
152 | [ run thread_safety_checking.cpp | |
11fdf7f2 TL |
153 | : : : <debug-symbols>off |
154 | <library>/boost/thread//boost_thread | |
155 | <library>/boost/timer//boost_timer | |
156 | <library>.//test_impl_lib_windbg_cached_no_dbg | |
157 | $(LINKSHARED_WIND_CACHED) | |
b32b8144 FG |
158 | : windbg_cached_lib_no_dbg_threaded ] |
159 | [ run thread_safety_checking.cpp | |
11fdf7f2 TL |
160 | : : : <debug-symbols>off |
161 | <library>/boost/thread//boost_thread | |
162 | <library>/boost/timer//boost_timer | |
163 | <library>.//test_impl_lib_basic_no_dbg | |
164 | $(LINKSHARED_BASIC) | |
b32b8144 FG |
165 | : basic_lib_no_dbg_threaded ] |
166 | ||
167 | [ run thread_safety_checking.cpp | |
11fdf7f2 TL |
168 | : : : <debug-symbols>off |
169 | <library>/boost/thread//boost_thread | |
170 | <library>/boost/timer//boost_timer | |
171 | <library>.//test_impl_lib_windbg | |
172 | $(LINKSHARED_WIND) | |
173 | <define>BOOST_STACKTRACE_TEST_COM_PREINIT_MT | |
b32b8144 FG |
174 | : windbg_lib_threaded_com_mt ] |
175 | [ run thread_safety_checking.cpp | |
11fdf7f2 TL |
176 | : : : <debug-symbols>off |
177 | <library>/boost/thread//boost_thread | |
178 | <library>/boost/timer//boost_timer | |
179 | <library>.//test_impl_lib_windbg_cached | |
180 | $(LINKSHARED_WIND_CACHED) | |
181 | <define>BOOST_STACKTRACE_TEST_COM_PREINIT_ST | |
b32b8144 FG |
182 | : windbg_cached_lib_threaded_com_st ] |
183 | ||
184 | [ run test_void_ptr_cast.cpp ] | |
185 | ; | |
186 | ||
187 | # Assuring that examples compile and run. Adding sources from `examples` directory to the `type_index` test suite. | |
188 | for local p in [ glob ../example/*.cpp ] | |
189 | { | |
190 | local target_name = $(p[1]:B) ; | |
191 | local additional_dependency = ; | |
192 | if $(target_name) = "terminate_handler" | |
193 | { | |
194 | additional_dependency = <library>/boost/filesystem//boost_filesystem <library>/boost/system//boost_system <target-os>linux:<library>rt ; | |
195 | } | |
196 | ||
197 | stacktrace_tests += [ run $(p) : : : <debug-symbols>on $(LINKSHARED_BT) $(additional_dependency) : backtrace_$(p2[1]:B) ] ; | |
198 | stacktrace_tests += [ run $(p) : : : <debug-symbols>on $(LINKSHARED_AD2L) $(additional_dependency) : addr2line_$(p[1]:B) ] ; | |
199 | stacktrace_tests += [ run $(p) : : : <debug-symbols>on $(LINKSHARED_WIND) $(additional_dependency) : windbg_$(p[1]:B) ] ; | |
200 | stacktrace_tests += [ run $(p) : : : <debug-symbols>on $(LINKSHARED_WIND_CACHED) $(additional_dependency) : windbg_cached_$(p[1]:B) ] ; | |
201 | stacktrace_tests += [ run $(p) : : : <debug-symbols>on $(LINKSHARED_NOOP) $(additional_dependency) : noop_$(p[1]:B) ] ; | |
202 | stacktrace_tests += [ run $(p) : : : <debug-symbols>on $(LINKSHARED_BASIC) $(additional_dependency) : basic_$(p[1]:B) ] ; | |
203 | ||
204 | ||
205 | ##### Tests with disabled debug symbols ##### | |
206 | ||
207 | stacktrace_tests += [ run $(p) : : : <debug-symbols>off $(LINKSHARED_BT) $(additional_dependency) : backtrace_$(p[1]:B)_no_dbg ] ; | |
208 | stacktrace_tests += [ run $(p) : : : <debug-symbols>off $(LINKSHARED_AD2L) $(additional_dependency) : addr2line_$(p[1]:B)_no_dbg ] ; | |
209 | stacktrace_tests += [ run $(p) : : : <debug-symbols>off $(LINKSHARED_WIND) $(additional_dependency) : windbg_$(p[1]:B)_no_dbg ] ; | |
210 | stacktrace_tests += [ run $(p) : : : <debug-symbols>off $(LINKSHARED_WIND_CACHED) $(additional_dependency) : windbg_cached_$(p[1]:B)_no_dbg ] ; | |
211 | stacktrace_tests += [ run $(p) : : : <debug-symbols>off $(LINKSHARED_NOOP) $(additional_dependency) : noop_$(p[1]:B)_no_dbg ] ; | |
212 | stacktrace_tests += [ run $(p) : : : <debug-symbols>off $(LINKSHARED_BASIC) $(additional_dependency) : basic_$(p[1]:B)_no_dbg ] ; | |
213 | ||
214 | } | |
215 |