diff options
author | Bryan Haber <bhaber@tableau.com> | 2018-02-26 12:13:19 -0800 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2018-08-20 21:24:12 +0200 |
commit | 31bdb74f48e8cc796ef28ab9c840c8c04ef54ebf (patch) | |
tree | edb03019c17c6ed31c73bc326a30505744bad8f1 | |
parent | b0fcca5879f1e8ffb0dfd43510e656cd84ca742a (diff) | |
download | qtlocation-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
-rw-r--r-- | CMakeLists.txt | 6 | ||||
-rw-r--r-- | cmake/mason.cmake | 16 |
2 files changed, 11 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index d524f2e754..b007b541b7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,7 +54,7 @@ if(WITH_COVERAGE) set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --coverage") endif(WITH_COVERAGE) -set(CMAKE_CONFIGURATION_TYPES Debug Release RelWithDebugInfo Sanitize) +set(CMAKE_CONFIGURATION_TYPES Debug Release RelWithDebInfo Sanitize) # Compiler configuration set(CMAKE_CXX_EXTENSIONS OFF) @@ -92,7 +92,6 @@ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Os -DNDEBUG") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O3 -DNDEBUG") set(CMAKE_CXX_FLAGS_SANITIZE "${CMAKE_CXX_FLAGS_SANITIZE} -O1 -g -fno-omit-frame-pointer -fno-optimize-sibling-calls") - if(CMAKE_CXX_COMPILER_ID MATCHES ".*Clang") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=unknown-warning-option") elseif(CMAKE_COMPILER_IS_GNUCXX) @@ -100,6 +99,9 @@ elseif(CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fext-numeric-literals") endif() +set(CMAKE_SHARED_LINKER_FLAGS_SANITIZE "${CMAKE_SHARED_LINKER_FLAGS}") +set(CMAKE_EXE_LINKER_FLAGS_SANITIZE "${CMAKE_EXE_LINKER_FLAGS}") + # Technique from https://crascit.com/2016/04/09/using-ccache-with-cmake/ find_program(CCACHE_PROGRAM ccache) if(CCACHE_PROGRAM) 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}") |