Switch to using a shared object library
A static library will create problems when using the library with clang if the library was created with g++. This is because clang always expects position-independent code, while this is not the default for g++. Since static libraries are hardly used anymore, the best solution is to switch to using a shared object library where using position-independent code is required anyway... This required quite a bit of redesign, especially for macOS targets. As a result support for macOS has improved now as well.