From 3e23f3f725d854a6ecfa4b77ac8d163340416301 Mon Sep 17 00:00:00 2001 From: Nir Azkiel Date: Thu, 9 May 2024 17:00:44 +0300 Subject: [PATCH] force shallow clone of json --- CMake/json-download.cmake.in | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/CMake/json-download.cmake.in b/CMake/json-download.cmake.in index 2b719edd4b..ac7a5099b9 100644 --- a/CMake/json-download.cmake.in +++ b/CMake/json-download.cmake.in @@ -5,15 +5,16 @@ include(ExternalProject) ExternalProject_Add( nlohmann_json PREFIX . - GIT_REPOSITORY "https://github.com/nlohmann/json.git" - GIT_TAG v3.11.3 - GIT_CONFIG advice.detachedHead=false # otherwise we'll get "You are in 'detached HEAD' state..." - SOURCE_DIR "${CMAKE_BINARY_DIR}/third-party/json" - GIT_SHALLOW 1 # No history needed (requires cmake 3.6) + + # We do not use 'GIT_REPOSITORY' as it doesn't support a shallow clone of a specific commit, + # this make the clone step very long, so we clone by ourselves + DOWNLOAD_COMMAND git clone -c advice.detachedHead=false --branch v3.11.3 https://github.com/nlohmann/json.git --depth 1 json + DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/third-party/ + # Override default steps with no action, we just want the clone step. + UPDATE_COMMAND "" CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "" ) -