diff --git a/CInterface/Core.cpp b/CInterface/Core.cpp index 0e938aa..850a92d 100644 --- a/CInterface/Core.cpp +++ b/CInterface/Core.cpp @@ -1,7 +1,7 @@ #include "Core.hpp" std::string ExceptionHandler::_creatureLibLastException = ""; -std::string ExceptionHandler::_creatureLibLastExceptionStacktrace = ""; +std::string ExceptionHandler::_creatureLibLastExceptionStacktrace = "Unset"; export const char* CreatureLib_C_GetLastException() { return ExceptionHandler::GetLastException(); } export const char* CreatureLib_C_GetLastExceptionStacktrace() { return ExceptionHandler::GetLastExceptionStacktrace(); } diff --git a/CInterface/Core.hpp b/CInterface/Core.hpp index 7e8e007..b12ba62 100644 --- a/CInterface/Core.hpp +++ b/CInterface/Core.hpp @@ -21,11 +21,14 @@ public: ss << "[" << function << "] " << e.what(); _creatureLibLastException = ss.str(); _creatureLibLastExceptionStacktrace = e.GetStacktrace(depth, true); + if (_creatureLibLastExceptionStacktrace.empty()) + _creatureLibLastExceptionStacktrace = "err"; } static void SetLastException(const std::string& function, const std::exception& e) { std::stringstream ss; ss << "[" << function << "] " << e.what(); _creatureLibLastException = ss.str(); + _creatureLibLastExceptionStacktrace = "Exception did not have a stacktrace."; } static const char* GetLastException() { return _creatureLibLastException.c_str(); } static const char* GetLastExceptionStacktrace() { return _creatureLibLastExceptionStacktrace.c_str(); } diff --git a/CMakeLists.txt b/CMakeLists.txt index cbeb3f1..5e67344 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,11 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") add_compile_options(-fconcepts) endif () +if (NOT WINDOWS) + # Include debug symbols in all linux builds + add_compile_options(-g -gfull -g3) +endif () + include(CmakeConanSetup.cmake) SetupConan() @@ -44,7 +49,7 @@ endif (WINDOWS) # Set up links to all relevant libraries. SET(_LIBRARYLINKS Arbutils) if (NOT WINDOWS) - set(_LIBRARYLINKS ${_LIBRARYLINKS} -lbfd -ldl) + set(_LIBRARYLINKS ${_LIBRARYLINKS} -ldw) endif () # If we need to link the C libraries statically, do so.