aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-06-13 23:41:31 +0200
committerHampusM <hampus@hampusmat.com>2022-06-13 23:41:31 +0200
commit65c9a400d56b7412dbac03d93412ba4de1734396 (patch)
treebddc51e4234a5b087b2d026856eac15f3d0678e5
parent26e628b2721867b082fc26466017225c6105cde7 (diff)
refactor: add uncaught exception stack traces
-rw-r--r--lib/CMakeLists.txt9
-rw-r--r--lib/backward/CMakeLists.txt3
-rw-r--r--src/CMakeLists.txt3
-rw-r--r--src/engine/main.cpp4
4 files changed, 19 insertions, 0 deletions
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 9a18dbe..b42daad 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -32,6 +32,15 @@ FetchContent_Declare(
add_subdirectory(ctre)
+FetchContent_Declare(
+ backward
+ GIT_REPOSITORY "https://github.com/bombela/backward-cpp"
+ GIT_TAG v1.6
+)
+
+add_subdirectory(backward)
+
+
if(test)
FetchContent_Declare(
gtest
diff --git a/lib/backward/CMakeLists.txt b/lib/backward/CMakeLists.txt
new file mode 100644
index 0000000..730ca1c
--- /dev/null
+++ b/lib/backward/CMakeLists.txt
@@ -0,0 +1,3 @@
+message(STATUS "Fetching Backward...")
+
+FetchContent_MakeAvailable(backward)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index f6b27cb..c0ebbe2 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -62,12 +62,15 @@ endif()
target_include_directories(${PROJECT_NAME} PRIVATE .)
+target_link_libraries(${PROJECT_NAME} dw)
+
target_link_libraries_system(
${PROJECT_NAME}
fmt::fmt-header-only
GSL
yacppdic
ctre
+ backward
)
target_link_options(${PROJECT_NAME} PRIVATE -fsanitize=address)
diff --git a/src/engine/main.cpp b/src/engine/main.cpp
index b4955b5..b703218 100644
--- a/src/engine/main.cpp
+++ b/src/engine/main.cpp
@@ -2,8 +2,12 @@
#include "bootstrap.hpp"
+#include <backward.hpp>
+
auto main() noexcept -> int
{
+ backward::SignalHandling signal_handling;
+
auto container = bootstrap();
auto engine = container.get<ICLIGameEngine>();