Skip to content

Commit

Permalink
PR #12914 from Nir-Az: Force shallow clone of json 3-rd party
Browse files Browse the repository at this point in the history
  • Loading branch information
Nir-Az committed May 12, 2024
2 parents 998aaa1 + c025eeb commit 8524975
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions CMake/json-download.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@ 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 (See https://gitlab.kitware.com/cmake/cmake/-/issues/17770).
# Adding detachedHead=false to avoid warnings like: "You are in 'detached HEAD' state..."
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 ""
)


0 comments on commit 8524975

Please sign in to comment.