Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake tweaks to support build acceleration #39787

Merged
merged 2 commits into from
Apr 22, 2020

Conversation

jbytheway
Copy link
Contributor

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.

Rather than using a static library for the coomon files, use an object
library.  Also, name it as a "common" thing, rather than a "lib" thing.

This is a better fit for our use case, since we have no interest in
actually installing the common library code as a library.

Requires explicitly excluding messages.cpp from common files (since they
conflict with test definitions).  Previously this worked due to the
archive member being ignored.
There are situations where ccache causes problems (such as interactions
with other build accelerators) so it's useful to be able to turn it off.
It remains on by default.
@kevingranade kevingranade merged commit 7bdd0c7 into CleverRaven:master Apr 22, 2020
@jbytheway jbytheway deleted the cmake_object_library branch April 22, 2020 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants