mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-01 21:17:44 -05:00
build: Fix undefined references
This commit is contained in:
@@ -18,7 +18,7 @@ if (NOT IMHEX_DISABLE_STACKTRACE)
|
||||
}
|
||||
" HAVE_STDCPPEXP)
|
||||
if (HAVE_STDCPPEXP)
|
||||
target_link_libraries(tracing PRIVATE stdc++exp)
|
||||
target_link_libraries(tracing PUBLIC stdc++exp)
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
@@ -49,6 +49,7 @@ endif()
|
||||
if (IMHEX_TRACE_EXCEPTIONS)
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||
target_link_options(tracing PUBLIC "-Wl,--wrap=__cxa_throw")
|
||||
target_compile_definitions(tracing PRIVATE HEX_WRAP_CXA_THROW)
|
||||
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
# Not supported currently
|
||||
endif()
|
||||
|
||||
@@ -15,13 +15,16 @@ namespace hex::trace {
|
||||
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
#if defined(HEX_WRAP_CXA_THROW)
|
||||
|
||||
extern "C" {
|
||||
|
||||
[[noreturn]] void __real___cxa_throw(void* thrownException, void* type, void (*destructor)(void*));
|
||||
[[noreturn]] void __wrap___cxa_throw(void* thrownException, void* type, void (*destructor)(void*)) {
|
||||
hex::trace::s_lastExceptionStackTrace = hex::trace::getStackTrace();
|
||||
__real___cxa_throw(thrownException, type, destructor);
|
||||
}
|
||||
|
||||
[[noreturn]] void __real___cxa_throw(void* thrownException, void* type, void (*destructor)(void*));
|
||||
[[noreturn]] void __wrap___cxa_throw(void* thrownException, void* type, void (*destructor)(void*)) {
|
||||
hex::trace::s_lastExceptionStackTrace = hex::trace::getStackTrace();
|
||||
__real___cxa_throw(thrownException, type, destructor);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user