Ported changes in build system from master to experimental