Since we switched Yosys to CMake, I wanted as simple a workflow as before. Thankfully user presets are super convenient. Here’s my presets file:
With this I can do, for example, cmake --workflow --preset d to configure and build a debug build or cmake --workflow --preset ri to configure and build and install a release build. Reconfiguration and rebuild is super fast like this, I never have to remove build/. You can use this file the same way, just adjust job count as needed. For testing, I use make -C tests YOSYS=(readlink -f ./build/yosys) -j24 (the missing dollar before open parenthesis is a fish shell thing).
But this is just my workflow, with ccache and clang. So it’s not necessarily something that would work for everybody. Are you using CMake differently? Post your commands or preset files or any other questions in this thread
I’m still undecided on the LTO (CMAKE_INTERPROCEDURAL_OPTIMIZATION). The Ninja config I keep around just in case. The clean build preset is handy and I usually use it after changing branches after many experiences (mostly with the old build system) of things getting desynced and causing strange issues (I do sometimes do a rm -rf build just to be sure). The bisect build/workflow presets got added while I was bisecting a docs-prepare failure (IIRC I was doing a rm -rf build && cmake --workflow --preset bisect because there were weird cache things going on). I know the file supports test presets; I’m not sure if that would work well with the current call out to make that we currently rely on for tests, so I haven’t looked into it yet.
My current problem is that if I don’t immediately git submodule update after changing branch or pulling main then VS Code raises the error about the ABC commit not matching, but otherwise having VS Code hooking into the CMake system to automatically pick up the presets and build targets is quite handy.