Skip to content

Commit cb2981c

Browse files
keithpotzvicromsdg0yt
authored
[crashcatch] Add new port (#50582)
Co-authored-by: Victor Romero <romerosanchezv@gmail.com> Co-authored-by: Kai Pastor <dg0yt@darc.de>
1 parent 7385231 commit cb2981c

5 files changed

Lines changed: 93 additions & 0 deletions

File tree

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index 7979fae..5d98d0f 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -4,6 +4,9 @@ project(CrashCatchExamples VERSION 1.4.0 LANGUAGES CXX)
6+
set(CMAKE_CXX_STANDARD 17)
7+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
8+
9+
+option(CRASHCATCH_BUILD_EXAMPLES "Build example programs" OFF)
10+
+option(CRASHCATCH_BUILD_TESTS "Build test programs" OFF)
11+
+
12+
# === Detect Platform & Set Platform Libraries ===
13+
if(WIN32)
14+
message(STATUS "Target platform: Windows")
15+
@@ -55,6 +58,7 @@ install(FILES
16+
DESTINATION lib/cmake/CrashCatch
17+
)
18+
19+
+if(CRASHCATCH_BUILD_EXAMPLES)
20+
# === Examples ===
21+
add_executable(Example_ZeroConfig examples/Example_ZeroConfig.cpp)
22+
target_link_libraries(Example_ZeroConfig PRIVATE CrashCatch)
23+
@@ -79,11 +83,13 @@ target_link_libraries(Example_StackTrace PRIVATE CrashCatch)
24+
25+
add_executable(Example_UploadCrash examples/Example_UploadCrash.cpp)
26+
target_link_libraries(Example_UploadCrash PRIVATE CrashCatch)
27+
+endif()
28+
29+
+if(CRASHCATCH_BUILD_TESTS)
30+
# === Tests ===
31+
add_executable(test_callback_order tests/test_callback_order.cpp)
32+
target_link_libraries(test_callback_order PRIVATE CrashCatch)
33+
34+
add_executable(test_stack_context tests/test_stack_context.cpp)
35+
target_link_libraries(test_stack_context PRIVATE CrashCatch)
36+
-
37+
+endif()

ports/crashcatch/portfile.cmake

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
set(VCPKG_BUILD_TYPE release) # header-only library
2+
3+
vcpkg_from_github(
4+
OUT_SOURCE_PATH SOURCE_PATH
5+
REPO keithpotz/CrashCatch
6+
REF "v${VERSION}"
7+
SHA512 ba3f431b1c1da9f8ead4038ff8073df3010394ce84a6976ba6b9e9f50842a3aacb367b443a92fef75317ee49cf08384a39d76b944bf1e2735d3e2a3647c63f01
8+
HEAD_REF main
9+
PATCHES
10+
fix-disable-examples-tests.patch
11+
)
12+
13+
vcpkg_cmake_configure(
14+
SOURCE_PATH "${SOURCE_PATH}"
15+
OPTIONS
16+
-DCRASHCATCH_BUILD_EXAMPLES=OFF
17+
-DCRASHCATCH_BUILD_TESTS=OFF
18+
)
19+
20+
vcpkg_cmake_install()
21+
vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/CrashCatch")
22+
23+
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug")
24+
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib")
25+
26+
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")

ports/crashcatch/vcpkg.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "crashcatch",
3+
"version": "1.4.0",
4+
"description": "A cross-platform, single-header C++ crash-reporting library for modern C++ applications.",
5+
"homepage": "https://github.com/keithpotz/CrashCatch",
6+
"license": "MIT",
7+
"dependencies": [
8+
{
9+
"name": "vcpkg-cmake",
10+
"host": true
11+
},
12+
{
13+
"name": "vcpkg-cmake-config",
14+
"host": true
15+
}
16+
]
17+
}

versions/baseline.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2176,6 +2176,10 @@
21762176
"baseline": "2020-04-26",
21772177
"port-version": 2
21782178
},
2179+
"crashcatch": {
2180+
"baseline": "1.4.0",
2181+
"port-version": 0
2182+
},
21792183
"crashpad": {
21802184
"baseline": "2024-04-11",
21812185
"port-version": 10

versions/c-/crashcatch.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"versions": [
3+
{
4+
"git-tree": "d2d98d530427d030b94cf84bd19eb81f2e113dab",
5+
"version": "1.4.0",
6+
"port-version": 0
7+
}
8+
]
9+
}

0 commit comments

Comments
 (0)