Someone at the last conference asked about workflow to help with contributing to csound.
I just wanted to bring it to attention, perhaps c-developer wizards were already aware of this.
That instead of waiting 1-2 minutes to wait for csound to fully rebuild and then see if the changes made were correct. It’s possible to use cmake and ninja together in such a way that rebuilds take less than 3 seconds, and only the files which changed are rebuilt, or the files that changed and the dependencies of those files.
In this screenshot, I rebuilt a file with added printf statement, and ran a test csd file, all within 3 seconds.
I’ll explain how I did this with nix on osx, but nix is only a factor for the dependencies.
I enter a shell with the dependencies I need to build csound, these dependencies I don’t want globally installed so I just create a shell with them when needed (I’ve made a fish function that does this for me)
nix-shell -p cmake libsndfile flex bison boost portaudio gettext clang ninja
now to the magic
$ cmake -Bbuild -H. -GNinja
this will create a new directory “build” with Ninja generator set up correctly configured
$ cd build
now it’s possible to rebuild csound from scratch with
$ ninja
and from this moment on, every time you make a change in the csound c sources, you can, from that directory build, rebuild only the changed c source files by calling again ninja, and a new csound executeable binary will be made with those changes.
For me this is a dramatic save of time, and makes everything much more fun. I wish someone told me earlier about ninja ![]()
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

