[llvm] Add CMake configure preset building blocks (PR #170019)
Richard Thomson via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 5 10:43:36 PST 2026
LegalizeAdulthood wrote:
> Then the question is can I update my setup to be based upon the thus committed CMakePresets.json.
The answer is easily no.
I'm not sure I understand why the answer is "no". Your existing presets (which, as you note, should have been in `CMakeUserPresets.json` all along) are unaffected unless you happened to choose names for your personal presets that conflict with the preset building blocks that were added.
> Where I'd used just "BUILD_SHARED_LIBS": true, I'd replace that with llvm-build-shared-libs which is pretty much the same amount of text, but elsewhere and with a different name.
It enables composition of options instead of copy/pasting options and duplicating them.
> So it saves nothing and makes it necessary to know another name.
Nothing is "necessary" with the added building blocks. You can continue to set variables yourself if you want. Nothing requires using these building blocks or makes anything "necessary".
> What about other combinations? [besides clang, clang-tools-extra]
This is a reasonable criticism and honestly this was the one building block I had the most back-and-forth in my mind about adding because of the other combinations. There isn't any mechanism in CMake presets for modifying variables, such as appending values, only defining them. One could argue the preset name is overly broad or too user-specific, but again, this is opt-in and doesn't impose requirements on anyone.
https://github.com/llvm/llvm-project/pull/170019
More information about the llvm-commits
mailing list