2020-09-01 08:57:35 +08:00
|
|
|
vcpkg_download_distfile(ARCHIVE
|
2023-03-30 07:21:26 +08:00
|
|
|
URLS "https://github.com/getsentry/sentry-native/releases/download/${VERSION}/sentry-native.zip"
|
|
|
|
FILENAME "sentry-native-${VERSION}.zip"
|
2024-03-28 07:56:21 +08:00
|
|
|
SHA512 bf6d9aef8129d9ad9b1617e03bf7ac5e4ac5572ac87546f9428a359c4fc3364d2591cc001e7a28f50509d5cfddab9a17da2d4a33e344280fd490c8fe5173f2c7
|
2020-09-01 08:57:35 +08:00
|
|
|
)
|
|
|
|
|
2022-12-09 02:43:37 +08:00
|
|
|
vcpkg_extract_source_archive(
|
|
|
|
SOURCE_PATH
|
2023-01-24 08:25:17 +08:00
|
|
|
ARCHIVE "${ARCHIVE}"
|
2020-09-01 08:57:35 +08:00
|
|
|
NO_REMOVE_ONE_LEVEL
|
2020-12-12 09:41:02 +08:00
|
|
|
PATCHES
|
|
|
|
fix-config-cmake.patch
|
2024-03-28 07:56:21 +08:00
|
|
|
fix-crashpad-wer.patch
|
2020-09-01 08:57:35 +08:00
|
|
|
)
|
2023-01-24 08:25:17 +08:00
|
|
|
file(REMOVE_RECURSE "${SOURCE_PATH}/external/crashpad/third_party/zlib/zlib")
|
2020-09-01 08:57:35 +08:00
|
|
|
|
2023-01-24 08:25:17 +08:00
|
|
|
vcpkg_list(SET options)
|
|
|
|
|
|
|
|
if(NOT "backend" IN_LIST FEATURES)
|
|
|
|
vcpkg_list(APPEND options "-DSENTRY_BACKEND=none")
|
2024-03-28 07:56:21 +08:00
|
|
|
elseif("wer" IN_LIST FEATURES)
|
|
|
|
vcpkg_list(APPEND options "-DSENTRY_BACKEND=crashpad")
|
2023-01-24 08:25:17 +08:00
|
|
|
elseif(DEFINED SENTRY_BACKEND)
|
|
|
|
# Legacy, possible override from triplet, but cannot handle dependencies
|
|
|
|
vcpkg_list(APPEND options "-DSENTRY_BACKEND=${SENTRY_BACKEND}")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(NOT "transport" IN_LIST FEATURES)
|
|
|
|
vcpkg_list(APPEND options "-DSENTRY_TRANSPORT=none")
|
2020-09-05 12:12:47 +08:00
|
|
|
endif()
|
|
|
|
|
2024-03-28 07:56:21 +08:00
|
|
|
if("wer" IN_LIST FEATURES)
|
|
|
|
vcpkg_list(APPEND options "-DSENTRY_TRANSPORT_CRASHPAD_USE_WER=ON")
|
|
|
|
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
|
2023-01-24 08:25:17 +08:00
|
|
|
${options}
|
2020-09-01 08:57:35 +08:00
|
|
|
-DSENTRY_BUILD_TESTS=OFF
|
|
|
|
-DSENTRY_BUILD_EXAMPLES=OFF
|
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
|
|
|
|
2023-01-24 08:25:17 +08:00
|
|
|
if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/crashpad_handler${VCPKG_TARGET_EXECUTABLE_SUFFIX}")
|
|
|
|
vcpkg_copy_tools(TOOL_NAMES crashpad_handler AUTO_CLEAN)
|
2020-09-01 08:57:35 +08:00
|
|
|
endif()
|
|
|
|
|
2023-01-24 08:25:17 +08:00
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
|
2024-03-28 07:56:21 +08:00
|
|
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|