# Your CMake workflows

**URL:** <https://yosyshq.discourse.group/t/your-cmake-workflows/155>\
**Category:** Developers\
**Created:** [July 23, 2026, 9:03am UTC](https://yosyshq.discourse.group/t/your-cmake-workflows/155 "2026-07-23T09:03:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![widlarizer](https://avatars.discourse-cdn.com/v4/letter/w/bbce88/32.png) [@widlarizer](https://yosyshq.discourse.group/u/widlarizer)\
**Post date:** [July 23, 2026, 9:03am UTC](https://yosyshq.discourse.group/t/your-cmake-workflows/155/1 "2026-07-23T09:03:47Z")

</div>

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:

> <https://gist.github.com/widlarizer/4c250ca490ea0808e64c49873ab126fe>

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

---

<div class="post-metadata">

**Author:** ![KrystalDelusion](https://avatars.discourse-cdn.com/v4/letter/k/8baadc/32.png) [@KrystalDelusion](https://yosyshq.discourse.group/u/KrystalDelusion)\
**Post date:** [July 23, 2026, 9:22pm UTC](https://yosyshq.discourse.group/t/your-cmake-workflows/155/2 "2026-07-23T21:22:30Z")

</div>

Here’s mine:

> <https://gist.github.com/KrystalDelusion/65b617d6fb875424444a4a3a0ea0d093>

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.
