-
Notifications
You must be signed in to change notification settings - Fork 2.5k
cmake: use a library target to avoid recompilation #3950
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
Conversation
e352ccb
to
9c0e65c
Compare
The |
It's relatively easy to get standalone binaries of new cmake versions, if this is worth requiring that. |
Hmm, interesting. The approach that I set out to take was simply to make a static library in the same manner and then create a shared library and the tests from that. This seemed a little less kludgey once I found it. Maybe I'll give that a whirl and see how effective it actually is. |
9c0e65c
to
6042b49
Compare
6042b49
to
9f9891d
Compare
9f9891d
to
db16c5e
Compare
db16c5e
to
f48190c
Compare
Policy CMP0042 handles MACOSX_RPATH behavior, which we do not use, but setting this explicitly suppresses the warning.
Our IDE_SPLIT_SOURCES needs to now expand TARGET_OBJECTs; enable CMP0051.
59b3b66
to
e78aafe
Compare
Closed, via #4513 |
Instead of listing the sources separately for the git2 target and the libgit2_clar target, create an "object library" target.
The object library will then be used to link both the git2 library target and the libgit2_clar target instead of having to compile all the source twice. The object library is compiled with the same flags as the prior git2 library target was, so it will correctly use the shared library flags (or the static library flags, if we're building a static libgit2) so the end results should be unchanged.