From c5ff9ed1f09f193e1965606e8dd39bf7e5086998 Mon Sep 17 00:00:00 2001 From: Vitalii Koshura Date: Sat, 5 Sep 2020 06:12:47 +0200 Subject: [sentry-native] Add ability to control SENTRY_BACKEND variable (#13362) --- ports/sentry-native/CONTROL | 2 +- ports/sentry-native/portfile.cmake | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ports/sentry-native/CONTROL b/ports/sentry-native/CONTROL index fbcf54f6c..a6166a379 100644 --- a/ports/sentry-native/CONTROL +++ b/ports/sentry-native/CONTROL @@ -1,6 +1,6 @@ Source: sentry-native Version: 0.4.0 -Port-Version: 1 +Port-Version: 2 Homepage: https://sentry.io/ Description: Sentry SDK for C, C++ and native applications. Build-Depends: curl (!windows) diff --git a/ports/sentry-native/portfile.cmake b/ports/sentry-native/portfile.cmake index 7370bd7d2..28fa4ea60 100644 --- a/ports/sentry-native/portfile.cmake +++ b/ports/sentry-native/portfile.cmake @@ -12,6 +12,18 @@ vcpkg_extract_source_archive_ex( NO_REMOVE_ONE_LEVEL ) +if (NOT DEFINED SENTRY_BACKEND) + if(MSVC AND CMAKE_GENERATOR_TOOLSET MATCHES "_xp$") + set(SENTRY_BACKEND "breakpad") + elseif(APPLE OR WIN32) + set(SENTRY_BACKEND "crashpad") + elseif(LINUX) + set(SENTRY_BACKEND "breakpad") + else() + set(SENTRY_BACKEND "inproc") + endif() +endif() + if (VCPKG_TARGET_IS_WINDOWS) set(SENTRY_NATIVE_C_STANDARD 99) else() @@ -26,6 +38,7 @@ vcpkg_configure_cmake( -DSENTRY_BUILD_TESTS=OFF -DSENTRY_BUILD_EXAMPLES=OFF -DCMAKE_C_STANDARD=${SENTRY_NATIVE_C_STANDARD} + -DSENTRY_BACKEND=${SENTRY_BACKEND} ) vcpkg_install_cmake() @@ -36,7 +49,7 @@ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/sentry TARGET_PATH share/sentry) -if (WIN32) +if (WIN32 AND SENTRY_BACKEND STREQUAL "crashpad") vcpkg_copy_tools( TOOL_NAMES crashpad_handler AUTO_CLEAN -- cgit v1.2.3