Some work towards improving the build time of third-party libraries (#352) [ci skip].