-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Force shallow clone of json 3-rd party #12914
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think better to keep the quotes in case the binary dir has spaces in it - though I'm not sure it matters. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should I try or keep it as is? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think quotes are better There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
|
||
# Override default steps with no action, we just want the clone step. | ||
UPDATE_COMMAND "" | ||
CONFIGURE_COMMAND "" | ||
BUILD_COMMAND "" | ||
INSTALL_COMMAND "" | ||
) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please point to the article you pointed to in the PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And also explain
advice.detachedHead=false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done