Apply patch from #3797 (Mac SDK option broken in build script)