Support changing lib type through BUILD_SHARED_LIBS