CMake tweaks to support build acceleration #39787
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
SUMMARY: Infrastructure "Switch CMake common files to an object library"
Purpose of change
I've been experimenting with some other build acceleration tools, and have made some changes to the CMake code to support that.
I think these are good changes to have independently of my specific purpose.
Describe the solution
There are a bunch of files common to the game and tests. Previously they were being made into a static library. Change them to be an object library instead. This means CMake compiles the objects once but links them twice. This saves disk space and I/O and eliminates one step of the compilation.
Add a new CMake option to allow disabling ccache. ccache can interact badly with some other build tools, and our CMake code was always using it when available. With this change, it's still on by default, but you can turn it off if you wish.
Testing
Ran some CMake builds.