Allow disabling pretty traces and remove dependency on libdw.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
37b1e16b34
commit
d59c13a34d
|
@ -10,6 +10,7 @@ option(WINDOWS "Whether the build target is Windows or not." OFF)
|
|||
option(SHARED "Whether we should build a shared library, instead of a static one." OFF)
|
||||
option(TESTS "Whether the test executable should be build as well." OFF)
|
||||
option(STATICC "Whether gcc and stdc++ should be linked statically to the library." OFF)
|
||||
option(PRETTYTRACES "Whether full stacktraces should be included. Note that this adds a dependency to libdw." ON)
|
||||
|
||||
# Set whether we want a static or shared library.
|
||||
set(LIBTYPE STATIC)
|
||||
|
@ -47,8 +48,9 @@ if (WINDOWS)
|
|||
endif (WINDOWS)
|
||||
|
||||
set(LINKS)
|
||||
if (NOT WINDOWS)
|
||||
if (NOT WINDOWS AND PRETTYTRACES)
|
||||
set(LINKS ${LINKS} -ldw)
|
||||
ADD_DEFINITIONS(-DPRETTYTRACES=1)
|
||||
endif()
|
||||
# If we want to link the C and C++ library statically, link those as well.
|
||||
if (STATICC)
|
||||
|
|
|
@ -6,7 +6,9 @@
|
|||
#include <string>
|
||||
#include <utility>
|
||||
#if !WINDOWS
|
||||
#if PRETTYTRACES
|
||||
#define BACKWARD_HAS_DW 1
|
||||
#endif
|
||||
#include "../extern/backward.hpp"
|
||||
#endif
|
||||
|
||||
|
@ -53,6 +55,9 @@ namespace ArbUt {
|
|||
backward::ResolvedTrace trace = tr.resolve(_stack[i]);
|
||||
if (trace.source.filename.empty()) {
|
||||
AppendNoSourceStack(ss, trace, include_addr);
|
||||
if (foundExceptionClass) {
|
||||
framesAppended++;
|
||||
}
|
||||
} else {
|
||||
AppendSourceStack(ss, trace.source, foundExceptionClass, snippetFactory);
|
||||
if (foundExceptionClass) {
|
||||
|
|
Loading…
Reference in New Issue