From cb08d46e818be726cce00fb42249f58b344c7314 Mon Sep 17 00:00:00 2001 From: past-due <30942300+past-due@users.noreply.github.com> Date: Tue, 11 Jun 2024 11:39:42 -0400 Subject: [PATCH] FetchSentryCLI.cmake: Fix detecting processor arch, improve download --- .ci/githubactions/FetchSentryCLI.cmake | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/.ci/githubactions/FetchSentryCLI.cmake b/.ci/githubactions/FetchSentryCLI.cmake index 7218ca2d11d..8aaf9d3e9f6 100644 --- a/.ci/githubactions/FetchSentryCLI.cmake +++ b/.ci/githubactions/FetchSentryCLI.cmake @@ -1,7 +1,12 @@ -cmake_minimum_required(VERSION 3.14...3.24) +cmake_minimum_required(VERSION 3.14...3.30) set(sentry_cli_version "2.32.1") # Note: When updating, must also update all of the sentry_cli_dl_sha512 below! +# Manually query the CMAKE_HOST_SYSTEM_PROCESSOR +# See: https://gitlab.kitware.com/cmake/cmake/-/issues/25151 +cmake_host_system_information(RESULT CMAKE_HOST_SYSTEM_PROCESSOR QUERY OS_PLATFORM) +message(STATUS "CMAKE_HOST_SYSTEM_PROCESSOR=${CMAKE_HOST_SYSTEM_PROCESSOR}") + # Construct the appropriate URL based on the current platform set(sentry_cli_dl_url "") set(sentry_cli_dl_sha512 "") @@ -30,14 +35,8 @@ else() message(FATAL_ERROR "Script does not currently support platform: ${CMAKE_HOST_SYSTEM_NAME}") endif() -include(FetchContent) -FetchContent_Populate( - sentry-cli - URL "${sentry_cli_dl_url}" - URL_HASH SHA512=${sentry_cli_dl_sha512} - DOWNLOAD_NAME "sentry-cli${_exe_suffix}" - DOWNLOAD_NO_EXTRACT TRUE - SOURCE_DIR sentry-cli -) +set(_output_fullpath "${CMAKE_CURRENT_BINARY_DIR}/sentry-cli/sentry-cli${_exe_suffix}") +file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/sentry-cli") +file(DOWNLOAD "${sentry_cli_dl_url}" "${_output_fullpath}" SHOW_PROGRESS TLS_VERIFY ON EXPECTED_HASH SHA512=${sentry_cli_dl_sha512}) -message(STATUS "Downloaded sentry-cli (${sentry_cli_version}) to: \"${CMAKE_CURRENT_BINARY_DIR}/sentry-cli/sentry-cli${_exe_suffix}\"") +message(STATUS "Downloaded sentry-cli (${sentry_cli_version}) to: \"${_output_fullpath}\"")