summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-02-26 16:38:12 (GMT)
committerBrad King <brad.king@kitware.com>2024-02-28 14:33:29 (GMT)
commitfe5e6c27bd1d9bbacd3baebdde878f989c82b79d (patch)
tree05a278bd443c64dab0e35d9ad8f997014f6c2a30
parentc481ddda14b3aa26a47da3a3f49b9fdaac5b77c7 (diff)
downloadCMake-fe5e6c27bd1d9bbacd3baebdde878f989c82b79d.zip
CMake-fe5e6c27bd1d9bbacd3baebdde878f989c82b79d.tar.gz
CMake-fe5e6c27bd1d9bbacd3baebdde878f989c82b79d.tar.bz2
ExternalProject: Prepare for multiple git submodule config options
-rw-r--r--Modules/ExternalProject.cmake30
1 files changed, 15 insertions, 15 deletions
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 8b10135..b7290db 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -1379,8 +1379,6 @@ function(_ep_write_gitclone_script
message(FATAL_ERROR "Tag for git checkout should not be empty.")
endif()
- set(git_submodules_config_options "")
-
if(GIT_VERSION_STRING VERSION_LESS 2.20 OR
2.21 VERSION_LESS_EQUAL GIT_VERSION_STRING)
set(git_clone_options "--no-checkout")
@@ -1403,21 +1401,23 @@ function(_ep_write_gitclone_script
if(NOT ${git_remote_name} STREQUAL "origin")
list(APPEND git_clone_options --origin \"${git_remote_name}\")
endif()
+
+ # The clone config option is sticky, it will apply to all subsequent git
+ # update operations. The submodules config option is not sticky, because
+ # git doesn't provide any way to do that. Thus, we will have to pass the
+ # same config option in the update step too for submodules, but not for
+ # the main git repo.
+ set(git_submodules_config_options "")
if(NOT "x${tls_verify}" STREQUAL "x")
- # The clone config option is sticky, it will apply to all subsequent git
- # update operations. The submodules config option is not sticky, because
- # git doesn't provide any way to do that. Thus, we will have to pass the
- # same config option in the update step too for submodules, but not for
- # the main git repo.
if(tls_verify)
# Default git behavior is "true", but the user might have changed the
# global default to "false". Since TLS_VERIFY was given, ensure we honor
# the specified setting regardless of what the global default might be.
list(APPEND git_clone_options -c http.sslVerify=true)
- set(git_submodules_config_options -c http.sslVerify=true)
+ list(APPEND git_submodules_config_options -c http.sslVerify=true)
else()
list(APPEND git_clone_options -c http.sslVerify=false)
- set(git_submodules_config_options -c http.sslVerify=false)
+ list(APPEND git_submodules_config_options -c http.sslVerify=false)
endif()
endif()
@@ -1480,19 +1480,19 @@ function(_ep_write_gitupdate_script
list(APPEND git_stash_save_options --all)
endif()
+ # The submodules config option is not sticky, git doesn't provide any way
+ # to do that. We have to pass this config option for the update step too.
+ # We don't need to set it for the non-submodule update because it gets
+ # recorded as part of the clone operation in a sticky manner.
set(git_submodules_config_options "")
if(NOT "x${tls_verify}" STREQUAL "x")
- # The submodules config option is not sticky, git doesn't provide any way
- # to do that. We have to pass this config option for the update step too.
- # We don't need to set it for the non-submodule update because it gets
- # recorded as part of the clone operation in a sticky manner.
if(tls_verify)
# Default git behavior is "true", but the user might have changed the
# global default to "false". Since TLS_VERIFY was given, ensure we honor
# the specified setting regardless of what the global default might be.
- set(git_submodules_config_options -c http.sslVerify=true)
+ list(APPEND git_submodules_config_options -c http.sslVerify=true)
else()
- set(git_submodules_config_options -c http.sslVerify=false)
+ list(APPEND git_submodules_config_options -c http.sslVerify=false)
endif()
endif()