[llvm] [docs][CMake] Add CMakePreset, improve VS documentation (PR #84760)

Tobias Hieta via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 13 06:51:10 PDT 2024


tru wrote:

> > > Thank you for the improvements here, it's really appreciated! Note, as a long-time user of this functionality, there is actually one thing that drives me bonkers over all other usability issues: because of the way the monorepo is set up, CMake support within Visual Studio is excellent for LLVM and terrible for every other project. For example, "go to definition", the solution explorer, etc are all focused solely on the `llvm` folder and have no knowledge of the `clang`, et al folders in the monorepo. The IDE experience is very much hampered by this, and anything we can do (either in terms of manual interventions, of which I've never found one, or in terms of presets, layout changes, etc) to improve this would be a _huge_ productivity boost. It's the _one_ feature I miss on a daily basis from using CMake to generate a solution file.
> > 
> > 
> > I wonder why this is, do you open the root `llvm-project` and not the `llvm` subfolder?
> 
> I open the `llvm` subfolder. You can't open the root `llvm-project` as a folder because it doesn't have a `CMakeLists.txt` file. My understanding of the issue (which could be wrong!) is that the problem is that Visual Studio expects there to be a top-level CMakeLists.txt and each subfolder then has its own, so with the way we have it set up where `llvm\CMakeLists.txt` drives things in sibling folders causes the IDE to get confused.

Try with branch! It adds a important file in `.vs` that will allow you to open the root folder and load the CMake out of `llvm` subfolder.

https://github.com/llvm/llvm-project/pull/84760


More information about the llvm-commits mailing list