summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2024-10-06 05:04:26 (GMT)
committerBrad King <brad.king@kitware.com>2024-10-07 14:24:37 (GMT)
commitfa07ddfebf69b5ea88799562ead7f6356e28ae01 (patch)
treefb4943d26edf15a6f91cabacebc9761438d7ead5 /Tests
parent5e4526d6dd473a5e47fea500377bc7b8de754e7f (diff)
downloadCMake-fa07ddfebf69b5ea88799562ead7f6356e28ae01.zip
CMake-fa07ddfebf69b5ea88799562ead7f6356e28ae01.tar.gz
CMake-fa07ddfebf69b5ea88799562ead7f6356e28ae01.tar.bz2
project: Only check non-cache vars when setting project vars
The change in commit 86ad7cc886 (project: Only define non-cache vars if already defined, 2024-09-15, v3.30.4~2^2) was meant to only check for non-cache variables when deciding whether to set non-cache project variables for the current call. However, it erroneously checked for any variable, including cache variables. This gives the intended result on the first run, but on subsequent runs a cache variable will exist that did not on the first run, leading to different behavior between the two runs. Fix the logic to only check for a pre-existing non-cache variable, as was originally intended. Fixes: #26355
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/project/RunCMakeTest.cmake7
1 files changed, 6 insertions, 1 deletions
diff --git a/Tests/RunCMake/project/RunCMakeTest.cmake b/Tests/RunCMake/project/RunCMakeTest.cmake
index e6e1bdb..ed4b8ba 100644
--- a/Tests/RunCMake/project/RunCMakeTest.cmake
+++ b/Tests/RunCMake/project/RunCMakeTest.cmake
@@ -45,7 +45,6 @@ run_cmake(ProjectIsTopLevel)
run_cmake(ProjectIsTopLevelMultiple)
run_cmake(ProjectIsTopLevelSubdirectory)
run_cmake(ProjectTwice)
-run_cmake(SameProjectVarsSubdir)
run_cmake(VersionAndLanguagesEmpty)
run_cmake(VersionEmpty)
run_cmake(VersionInvalid)
@@ -63,4 +62,10 @@ run_cmake(CMP0096-WARN)
run_cmake(CMP0096-OLD)
run_cmake(CMP0096-NEW)
+# We deliberately run these twice to verify behavior of the second CMake run
+run_cmake(SameProjectVarsSubdir)
+set(RunCMake_TEST_NO_CLEAN 1)
+run_cmake(SameProjectVarsSubdir)
+set(RunCMake_TEST_NO_CLEAN 0)
+
run_cmake(NoMinimumRequired)