Skip to content

cmake: fix linking in Xcode with object libraries only#4372

Merged
ethomson merged 1 commit intolibgit2:masterfrom
pks-t:pks/xcode-linking
Oct 9, 2017
Merged

cmake: fix linking in Xcode with object libraries only#4372
ethomson merged 1 commit intolibgit2:masterfrom
pks-t:pks/xcode-linking

Conversation

@pks-t
Copy link
Copy Markdown
Member

@pks-t pks-t commented Oct 9, 2017

CMake is unable to generate a correct Xcode project when trying to link
libraries with only object libraries as its input. As our new build
infrastructure makes heavy use of object libraries now, this affects our
libgit2 library target, as well, leading to linking errors.

Fix the issue by adding a dummy file to the libgit2 objects. As we
always have the "features.h" header ready which contains defines only,
we can simply link it into the resulting library without any effect
whatsoever. This fixes building with Xcode.


Thanks to @tiennou. This should fix #4352.

CMake is unable to generate a correct Xcode project when trying to link
libraries with only object libraries as its input. As our new build
infrastructure makes heavy use of object libraries now, this affects our
libgit2 library target, as well, leading to linking errors.

Fix the issue by adding a dummy file to the libgit2 objects. As we
always have the "features.h" header ready which contains defines only,
we can simply link it into the resulting library without any effect
whatsoever. This fixes building with Xcode.
@ethomson
Copy link
Copy Markdown
Member

ethomson commented Oct 9, 2017

Cool, thanks @tiennou and @pks-t .

@ethomson ethomson merged commit 34ec6f3 into libgit2:master Oct 9, 2017
@pks-t pks-t deleted the pks/xcode-linking branch November 11, 2017 20:36
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.

Missing libgit2.dylib

2 participants