Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
cmake_minimum_required(VERSION 3.21)
project(Crashlogs CXX)

add_library(Crashlogs STATIC)
if(WIN32)
target_sources(Crashlogs PRIVATE crashlogs.cpp)
target_compile_definitions(Crashlogs PRIVATE _CRT_SECURE_NO_WARNINGS)
endif()
target_include_directories(Crashlogs PUBLIC "\$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>")
target_compile_features(Crashlogs PUBLIC cxx_std_23)

set(CMAKE_INSTALL_INCLUDEDIR include/Crashlogs CACHE PATH "")
include(GNUInstallDirs)
install(FILES crashlogs.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
install(TARGETS Crashlogs EXPORT CrashlogsConfig INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
install(EXPORT CrashlogsConfig NAMESPACE Crashlogs:: DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/Crashlogs")
4 changes: 2 additions & 2 deletions crashlogs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,15 @@ namespace glaiel::crashlogs {
}

//various callbacks needed to get into the crash handler during a crash (borrowed from backward.cpp)
static inline void signal_handler(int signal) {
static inline void signal_handler(int) {
crash_handler();
abort();
}
static inline void terminator() {
crash_handler();
abort();
}
__declspec(noinline) static LONG WINAPI exception_handler(EXCEPTION_POINTERS* info) {
__declspec(noinline) static LONG WINAPI exception_handler(EXCEPTION_POINTERS*) {
crash_handler();
return EXCEPTION_CONTINUE_SEARCH;
}
Expand Down