8000 cmake: use a library target to avoid recompilation by ethomson · Pull Request #3950 · libgit2/libgit2 · GitHub
[go: up one dir, main page]

Skip to content

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

Closed
wants to merge 12 commits into from

Conversation

ethomson
Copy link
Member
@ethomson ethomson commented Oct 2, 2016

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.

@ethomson ethomson force-pushed the ethomson/cmake_object_library branch from e352ccb to 9c0e65c Compare October 2, 2016 01:27
@carlosmn
Copy link
Member
carlosmn commented Oct 2, 2016

The OBJECT target was added in 2.8.8. Unfortunately in Ubuntu 12.04 the version of CMake is 2.8.7, so it won't kow what to do with it unless we bump the version ourselves. But then we don't support that LTS version out of the box.

@tkelman
Copy link
Contributor
tkelman commented Oct 2, 2016

It's relatively easy to get standalone binaries of new cmake versions, if this is worth requiring that.

@ethomson
Copy link
Member Author
ethomson commented Oct 2, 2016

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.

@ethomson ethomson force-pushed the ethomson/cmake_object_library branch from 9c0e65c to 6042b49 Compare January 22, 2017 00:10
@ethomson ethomson force-pushed the ethomson/cmake_object_library branch from 6042b49 to 9f9891d Compare February 3, 2017 14:03
@ethomson ethomson force-pushed the ethomson/cmake_object_library branch from 9f9891d to db16c5e Compare February 4, 2017 17:46
@ethomson ethomson force-pushed the ethomson/cmake_object_library branch from db16c5e to f48190c Compare February 4, 2017 17:52
Edward Thomson added 7 commits February 5, 2017 11:39
@ethomson
Copy link
Member Author
ethomson commented Feb 3, 2018

Closed, via #4513

@ethomson ethomson closed this Feb 3, 2018
@ethomson ethomson deleted the ethomson/cmake_object_library branch January 9, 2019 10:17
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.

3 participants
0