The tricky part is static construction (needed for the Qt resource system
among other things), that isn't available with static libraries. I didn't
find a more elegant solution than an explicit init function for that.
Putting this up for review for the general concept, assuming we want static
library support in other libraries/frameworks too, as it has some benefits
for minimizing app bundles (such as Android APKs).