2020-09-01 08:57:35 +08:00
|
|
|
vcpkg_download_distfile(ARCHIVE
|
2022-06-22 04:37:50 +08:00
|
|
|
URLS "https://github.com/getsentry/sentry-native/releases/download/0.4.18/sentry-native.zip"
|
|
|
|
FILENAME "sentry-native-0.4.18.zip"
|
|
|
|
SHA512 4363961a4a1560cc8777932c890231013cd73a48c51a9d9ce8175b541674da007d3bfd0ed2c50d72da2d75aa49a9004a4ea6638c4754cf29568dd66ebdb596db
|
2020-09-01 08:57:35 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_extract_source_archive_ex(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
ARCHIVE ${ARCHIVE}
|
|
|
|
NO_REMOVE_ONE_LEVEL
|
2020-12-12 09:41:02 +08:00
|
|
|
PATCHES
|
|
|
|
fix-warningC5105.patch
|
|
|
|
fix-config-cmake.patch
|
2021-07-27 07:54:30 +08:00
|
|
|
use-zlib-target.patch
|
2020-09-01 08:57:35 +08:00
|
|
|
)
|
|
|
|
|
2020-09-05 12:12:47 +08:00
|
|
|
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()
|
|
|
|
|
2022-02-01 02:53:40 +08:00
|
|
|
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
|
|
|
|
set(VCPKG_CXX_FLAGS "/D_CRT_DECLARE_NONSTDC_NAMES ${VCPKG_CXX_FLAGS}")
|
|
|
|
set(VCPKG_C_FLAGS "/D_CRT_DECLARE_NONSTDC_NAMES ${VCPKG_C_FLAGS}")
|
|
|
|
endif()
|
|
|
|
|
2021-09-04 08:37:59 +08:00
|
|
|
vcpkg_cmake_configure(
|
2022-02-01 02:53:40 +08:00
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2020-09-01 08:57:35 +08:00
|
|
|
OPTIONS
|
|
|
|
-DSENTRY_BUILD_TESTS=OFF
|
|
|
|
-DSENTRY_BUILD_EXAMPLES=OFF
|
2020-09-05 12:12:47 +08:00
|
|
|
-DSENTRY_BACKEND=${SENTRY_BACKEND}
|
2021-07-27 07:54:30 +08:00
|
|
|
-DCRASHPAD_ZLIB_SYSTEM=ON
|
2022-04-26 06:49:08 +08:00
|
|
|
MAYBE_UNUSED_VARIABLES
|
|
|
|
CRASHPAD_ZLIB_SYSTEM
|
2020-09-01 08:57:35 +08:00
|
|
|
)
|
|
|
|
|
2021-09-04 08:37:59 +08:00
|
|
|
vcpkg_cmake_install()
|
2020-09-01 08:57:35 +08:00
|
|
|
|
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
|
|
|
|
2022-04-26 06:49:08 +08:00
|
|
|
vcpkg_cmake_config_fixup(PACKAGE_NAME sentry CONFIG_PATH lib/cmake/sentry)
|
2020-09-01 08:57:35 +08:00
|
|
|
|
2021-06-04 03:53:54 +08:00
|
|
|
if (SENTRY_BACKEND STREQUAL "crashpad")
|
2020-09-01 08:57:35 +08:00
|
|
|
vcpkg_copy_tools(
|
|
|
|
TOOL_NAMES crashpad_handler
|
|
|
|
AUTO_CLEAN
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
file(
|
2022-02-01 02:53:40 +08:00
|
|
|
INSTALL "${SOURCE_PATH}/LICENSE"
|
|
|
|
DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}"
|
2020-09-01 08:57:35 +08:00
|
|
|
RENAME copyright
|
|
|
|
)
|