Files
CMake/Tests/RunCMake/FileAPI/ConfigCaseReconfigure-prep.cmake
Daksh Mamodiya e6482b840a fileapi: Fix dangling reply reference on case-insensitive filesystems
Reply file names embed the configuration name verbatim.  Reconfiguring
a build tree with a build type that differs from the previous one only
in case (e.g. Debug -> debug) makes CMake write a reply whose name also
differs only in case from the existing file.  On a case-insensitive
filesystem the write is skipped because the name already exists, but
RemoveOldReplyFiles compared on-disk names to the just-written names
textually and deleted the surviving file, leaving the reply index
citing a target or directory reply that no longer exists on disk.

Prune reply files by file identity via cmSystemTools::GetFileId instead
of by name, so an on-disk entry that aliases a reply we just wrote is
kept.  An entry whose identity cannot be obtained is retained rather
than deleted.

Fixes: #28022
2026-08-06 17:44:54 +02:00

3 lines
149 B
CMake

file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query")
file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/codemodel-v2" "")