Currently will remain disabled everywhere, but this allows for enabling LTO for optimized, non-xcode jobs just by changing the value of the LTO variable.
Travis runs all commands in .travis.yml in its own wrapper script, so by sourcing steps/script.sh and then using exit explicitly, it resulted in the entire travis wrapper immediately terminating. With steps/script.sh no longer sourced, using exit works as expected again, and only exits steps/script.sh rather than quitting everything. Another solution, should sourcing steps/script.sh become necessary, is to use return instead of exit.
With that addressed, it's then possible to re-add printing the ccache statistics after the build ends while also making sure that the script exits with the return code of the xcodebuild/cmake+make command rather than the return code of the ccache statistics commands.
Travis looks at the return code of the final command run, and since printing the ccache statistics never fails, building would never be considered as failing. Manually calling exit also causes travis to treat the build as errored, since by sourcing the build it results in the entire travis wrapper shell exiting.