[sentry-native] Add ability to control SENTRY_BACKEND variable (#13362)

This commit is contained in:
Vitalii Koshura 2020-09-05 06:12:47 +02:00 committed by GitHub
parent 1d66e5dd5b
commit c5ff9ed1f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 2 deletions

View File

@ -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)

View File

@ -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