summaryrefslogtreecommitdiff
path: root/Modules/FetchContent.cmake
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2022-09-10 18:22:18 +1000
committerCraig Scott <craig.scott@crascit.com>2022-09-10 18:23:21 +1000
commitd9a6e0ffc82fbc460289c6b0808eff27ac316235 (patch)
tree65da7af4487afa648f674f2183c32978bd495600 /Modules/FetchContent.cmake
parenta2f9e674bb15d91af15cec815a5c40c0ecc2ee9f (diff)
downloadcmake-d9a6e0ffc82fbc460289c6b0808eff27ac316235.tar.gz
FetchContent: Fix unsetting wrong variable name after provider returns
The unset() command was using __cmake_contentNameLower before that variable was restored from the __cmake_fcCurrentVarsStack. That means if there had been a nested call to FetchContent_MakeAvailable(), the wrong variable name would have been cleared (the nested name instead of the one from the current call). That would have left the variable set upon return, blocking the dependency provider from seeing any further calls to FetchContent_MakeAvailable() in the current variable scope or below for the current dependency.
Diffstat (limited to 'Modules/FetchContent.cmake')
-rw-r--r--Modules/FetchContent.cmake2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/FetchContent.cmake b/Modules/FetchContent.cmake
index 20f0bd2a59..bb7e44d609 100644
--- a/Modules/FetchContent.cmake
+++ b/Modules/FetchContent.cmake
@@ -1893,13 +1893,13 @@ macro(FetchContent_MakeAvailable)
set(__cmake_fcProvider_${__cmake_contentNameLower} YES)
cmake_language(EVAL CODE "${__cmake_providerCommand}(${__cmake_providerArgs})")
- unset(__cmake_fcProvider_${__cmake_contentNameLower})
list(POP_BACK __cmake_fcCurrentVarsStack
__cmake_contentNameLower
__cmake_contentName
)
+ unset(__cmake_fcProvider_${__cmake_contentNameLower})
unset(__cmake_providerArgs)
unset(__cmake_addfpargs)
unset(__cmake_fpargs)