summaryrefslogtreecommitdiff
path: root/cmake/mason.cmake
diff options
context:
space:
mode:
authorBryan Haber <bhaber@tableau.com>2018-02-26 12:13:19 -0800
committerKonstantin Käfer <mail@kkaefer.com>2018-08-20 21:24:12 +0200
commit31bdb74f48e8cc796ef28ab9c840c8c04ef54ebf (patch)
treeedb03019c17c6ed31c73bc326a30505744bad8f1 /cmake/mason.cmake
parentb0fcca5879f1e8ffb0dfd43510e656cd84ca742a (diff)
downloadqtlocation-mapboxgl-31bdb74f48e8cc796ef28ab9c840c8c04ef54ebf.tar.gz
[build] fixed typo in list of configuration types; RelWithDebugInfo should be RelWithDebInfo
- added missing linker flags for Sanitize configuration type - changed mason's download to use cmake's built-in support instead of directly calling curl
Diffstat (limited to 'cmake/mason.cmake')
-rw-r--r--cmake/mason.cmake16
1 files changed, 7 insertions, 9 deletions
diff --git a/cmake/mason.cmake b/cmake/mason.cmake
index 00d268421a..76d02b95b5 100644
--- a/cmake/mason.cmake
+++ b/cmake/mason.cmake
@@ -84,17 +84,15 @@ function(mason_use _PACKAGE)
set(_URL "${MASON_REPOSITORY}/${_SLUG}.tar.gz")
message("[Mason] Downloading package ${_URL}...")
- set(_FAILED)
- set(_ERROR)
- # Note: some CMake versions are compiled without SSL support
+ set(_STATUS)
get_filename_component(_CACHE_DIR "${_CACHE_PATH}" DIRECTORY)
file(MAKE_DIRECTORY "${_CACHE_DIR}")
- execute_process(
- COMMAND curl --retry 3 -s -f -S -L "${_URL}" -o "${_CACHE_PATH}.tmp"
- RESULT_VARIABLE _FAILED
- ERROR_VARIABLE _ERROR)
- if(_FAILED)
- message(FATAL_ERROR "[Mason] Failed to download ${_URL}: ${_ERROR}")
+ file(DOWNLOAD "${_URL}" "${_CACHE_PATH}.tmp" STATUS _STATUS TLS_VERIFY ON)
+
+ list(GET _STATUS 0 _STATUS_CODE)
+ list(GET _STATUS 1 _STATUS_STRING)
+ if(NOT _STATUS_CODE EQUAL 0)
+ message(FATAL_ERROR "[Mason] Failed to download ${_URL}: ${_STATUS_STRING}")
else()
# We downloaded to a temporary file to prevent half-finished downloads
file(RENAME "${_CACHE_PATH}.tmp" "${_CACHE_PATH}")