Introduce a build mode option to allow switching towards a library build, supporting `.so` and `.a` outputs.