I frequently see meson (and other tools like cmake) using build directories, which is something I don't like. Is there a reason to this that I am not thinking of (besides being able to "rm -rf" everything instead of doing something like "make clean")?
Other than it being cleaner in many ways (all build artefacts in one place, your base directory structure never getting touched, no chance of accidentally checking in build artefacts into your repo), you can have several different build configurations 'active' in parallel (build.release, build.debug, build.cuda etc.) and then activate the right build by just going to the relevant folder and running make.
> you can have several different build configurations 'active' in parallel (build.release, build.debug, build.cuda etc.) and then activate the right build by just going to the relevant folder and running make.
That is an interesting use-case I hadn't heard of before. But I guess if that is really needed, you could also just have multiple checkouts?
FWIW, you can easily have that (separate build directories) with make(1), it’s just that’s it’s not the default.
Of course, I use make most of the time, but I'm used to having a .o file right next to my .c file.
Try lndir to create a separate build directory that has symbolic links to the files in the source tree.