mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-31 10:50:16 -06:00
FetchContent: Ensure can_fetch_default is set early enough
The can_fetch_default variable needs to be set before the call to _ep_write_gitupdate_script(). Move it to before that call and always set the variable, even if arg_SCRIPT_FILE is not set. This makes the generated git update script file easier to follow if someone tries to follow what it is doing or wants to investigate problems and run it manually. Fixes: #26164
This commit is contained in:
@@ -1535,6 +1535,12 @@ function(_ep_add_update_command name)
|
||||
set(comment "Performing update step for '${name}'")
|
||||
set(comment_disconnected "Performing disconnected update step for '${name}'")
|
||||
|
||||
if(update_disconnected)
|
||||
set(can_fetch_default NO)
|
||||
else()
|
||||
set(can_fetch_default YES)
|
||||
endif()
|
||||
|
||||
set(git_tag "${_EP_GIT_TAG}")
|
||||
if(NOT git_tag)
|
||||
set(git_tag "master")
|
||||
@@ -1602,11 +1608,6 @@ function(_ep_add_update_command name)
|
||||
set(always 1)
|
||||
|
||||
if(arg_SCRIPT_FILE)
|
||||
if(update_disconnected)
|
||||
set(can_fetch_default NO)
|
||||
else()
|
||||
set(can_fetch_default YES)
|
||||
endif()
|
||||
set(step_script_contents "include(\"${update_script}\")")
|
||||
endif()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user