Updated build script so as to enable or disable optimizations