summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2022-09-10 08:22:18 (GMT)
committerCraig Scott <craig.scott@crascit.com>2022-09-10 08:23:21 (GMT)
commitd9a6e0ffc82fbc460289c6b0808eff27ac316235 (patch)
tree65da7af4487afa648f674f2183c32978bd495600 /Modules
parenta2f9e674bb15d91af15cec815a5c40c0ecc2ee9f (diff)
downloadCMake-d9a6e0ffc82fbc460289c6b0808eff27ac316235.zip
CMake-d9a6e0ffc82fbc460289c6b0808eff27ac316235.tar.gz
CMake-d9a6e0ffc82fbc460289c6b0808eff27ac316235.tar.bz2
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')
-rw-r--r--Modules/FetchContent.cmake2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/FetchContent.cmake b/Modules/FetchContent.cmake
index 20f0bd2..bb7e44d 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)