This makes the default build configuration play nicely with code editors. E.g. with Zed, looking at spawn_argv in #231:
Before: <img width="1025" height="426" alt="before" src="https://github.com/user-attachments/assets/3b9881fd-7be2-49de-9180-b8517dda0394" />
After: <img width="911" height="427" alt="after" src="https://github.com/user-attachments/assets/42bac960-3d31-4bf4-9d42-7d92b72c13a9" />
One downside of this approach is that it only just works(tm) on the build directory.
There are several alternative approaches:
- Update documentation to recommend:
cmake -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
ln -sf build/compile_commands.json .
- Have cmake add a symlink to the source dir
- Add a (dev) cmake preset