cmake: use a library target to avoid recompilation - #3950
Closed
ethomson wants to merge 12 commits into
Closed
Conversation
ethomson
force-pushed
the
ethomson/cmake_object_library
branch
from
October 2, 2016 01:27
e352ccb to
9c0e65c
Compare
Member
|
The |
Contributor
|
It's relatively easy to get standalone binaries of new cmake versions, if this is worth requiring that. |
Member
Author
|
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
force-pushed
the
ethomson/cmake_object_library
branch
from
January 22, 2017 00:10
9c0e65c to
6042b49
Compare
ethomson
force-pushed
the
ethomson/cmake_object_library
branch
from
February 3, 2017 14:03
6042b49 to
9f9891d
Compare
ethomson
force-pushed
the
ethomson/cmake_object_library
branch
from
February 4, 2017 17:46
9f9891d to
db16c5e
Compare
ethomson
force-pushed
the
ethomson/cmake_object_library
branch
from
February 4, 2017 17:52
db16c5e to
f48190c
Compare
added 7 commits
February 5, 2017 11:39
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.
ethomson
force-pushed
the
ethomson/cmake_object_library
branch
from
February 5, 2017 13:19
59b3b66 to
e78aafe
Compare
Member
Author
|
Closed, via #4513 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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.