[llvm] [cmake] Preserve CMake file API queries when clearing an LLVM external project build directory (PR #206801)
Ian Anderson via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 6 23:01:06 PDT 2026
ian-twilightcoder wrote:
> > > When clearing the build d9irectory, I would want a fresh start, including not having such outdated queries preserved.
> >
> >
> > The problem is that the build system will clear the build directory for you depending on the stamps, and when that happens your IDE support gets clobbered with it and you have to set it all back up by hand which is a real pain. There's nothing outdated in the queries, it's the replies that are outdated and those aren't preserved.
>
> What's the purpose of these queries? Why do we need to preserve them?
Some IDEs like CLion use the CMake file api to populate the UI and build. The user creates the queries something like `mkdir -p build/.cmake/api/v1/query/{cache,codemodel}-v2`, then runs CMake something like `cmake -S runtimes -B build -GNinja -DLLVM_ENABLE_RUNTIMES=compiler-rt`. That fills in the replies that IDEs like CLion use to open the runtimes projects and build them. But if the stamps go stale due to branch switching or something like that, the build directory gets clobbered taking the queries with it, the replies don't get regenerated, and the user has to start all over again. If the queries are preserved the the replies get regenerated and the user can keep using their IDE.
https://github.com/llvm/llvm-project/pull/206801
More information about the llvm-commits
mailing list