cmake: disable shared library build when BUILD_SHARED_LIBS is off