mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-21 14:47:56 +08:00
96ce497722
Signed-off-by: Vitalii Koshura <lestat.de.lionkur@gmail.com>
70 lines
2.3 KiB
CMake
70 lines
2.3 KiB
CMake
vcpkg_download_distfile(ARCHIVE
|
|
URLS "https://github.com/getsentry/sentry-native/releases/download/${VERSION}/sentry-native.zip"
|
|
FILENAME "sentry-native-${VERSION}.zip"
|
|
SHA512 be19baf750071d1156b8d091a5c9731e7c549b872958b0f2ba519c9808eeac09b8d62f4165a9168856c90114973335e88fa79b505b575cba9bb9dc9a1c351436
|
|
)
|
|
|
|
vcpkg_extract_source_archive(
|
|
SOURCE_PATH
|
|
ARCHIVE "${ARCHIVE}"
|
|
NO_REMOVE_ONE_LEVEL
|
|
PATCHES
|
|
fix-crashpad-wer.patch
|
|
fix-usage-runtime.patch
|
|
)
|
|
file(REMOVE_RECURSE "${SOURCE_PATH}/external/crashpad/third_party/zlib/zlib")
|
|
|
|
vcpkg_list(SET options)
|
|
|
|
if(NOT "backend" IN_LIST FEATURES)
|
|
vcpkg_list(APPEND options "-DSENTRY_BACKEND=none")
|
|
elseif("wer" IN_LIST FEATURES)
|
|
vcpkg_list(APPEND options "-DSENTRY_BACKEND=crashpad")
|
|
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")
|
|
endif()
|
|
|
|
if("wer" IN_LIST FEATURES)
|
|
vcpkg_list(APPEND options "-DSENTRY_TRANSPORT_CRASHPAD_USE_WER=ON")
|
|
endif()
|
|
|
|
if("compression" IN_LIST FEATURES)
|
|
vcpkg_list(APPEND options "-DSENTRY_TRANSPORT_COMPRESSION=ON")
|
|
endif()
|
|
|
|
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()
|
|
|
|
vcpkg_cmake_configure(
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
|
OPTIONS
|
|
${options}
|
|
-DSENTRY_BUILD_TESTS=OFF
|
|
-DSENTRY_BUILD_EXAMPLES=OFF
|
|
-DCRASHPAD_ZLIB_SYSTEM=ON
|
|
MAYBE_UNUSED_VARIABLES
|
|
CRASHPAD_ZLIB_SYSTEM
|
|
)
|
|
|
|
vcpkg_cmake_install()
|
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
|
|
|
vcpkg_cmake_config_fixup(PACKAGE_NAME sentry CONFIG_PATH lib/cmake/sentry)
|
|
|
|
if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/crashpad_handler${VCPKG_TARGET_EXECUTABLE_SUFFIX}")
|
|
vcpkg_copy_tools(TOOL_NAMES crashpad_handler AUTO_CLEAN)
|
|
endif()
|
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
|
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|