Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

tiennou
Copy link
Contributor

@tiennou tiennou commented May 25, 2018

mbedTLS has no pkgconfig file, hence we can't require it. For now, pass its link flags as our own.

Ref: #4651

# mbedTLS has no pkgconfig file, hence we can't require it
# https://github.com/ARMmbed/mbedtls/issues/228
# For now, pass its link flags as our own
LIST(APPEND LIBGIT2_PC_LIBS ${MBEDTLS_LIBRARIES})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to be sure here: does MBEDTLS_LIBRARIES include MBEDTLS_LDFLAGS?

Copy link
Contributor Author

@tiennou tiennou May 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a little bit weirder : the FindmbedTLS module doesn't actually set MBEDTLS_LDFLAGS at all, so I hope this is sufficient. AFAIU, Libs.private only impacts static linking (ie. pkg-config libgit2 --static --libs), and the linker should already know what to do when dyn-linking.

The resulting pc file looks like this :

prefix="/usr/local"
libdir=${prefix}/lib
includedir=${prefix}/include

Name: libgit2
Description: The git library, take 2
Version: 0.27.0

Libs: -L${libdir} -lgit2
Libs.private: -lcurl -L/usr/local/lib -lmbedtls -lmbedx509 -lmbedcrypto -lz -L/usr/local/Cellar/libssh2/1.8.0/lib -lssh2 -L/usr/lib -liconv
Requires.private: 

Cflags: -I${includedir}

# https://github.com/ARMmbed/mbedtls/issues/228
# For now, pass its link flags as our own
LIST(APPEND LIBGIT2_PC_LIBS ${MBEDTLS_LIBRARIES})
# LIST(APPEND LIBGIT2_PC_REQUIRES "mbedtls")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say to just remove this line. Having commented-out sections can be confusing, and you're able to easily dig up this code by just git-blaming the above comment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, removed.

mbedTLS has no pkgconfig file, hence we can't require it. For now, pass its link flags as our own.
@tiennou tiennou force-pushed the fix/mbedtls-no-pkgconfig branch from e67fdac to 64a78a8 Compare May 25, 2018 12:43
@tiennou tiennou mentioned this pull request May 25, 2018
@pks-t pks-t merged commit 36ae5c9 into libgit2:master May 30, 2018
@pks-t
Copy link
Member

pks-t commented May 30, 2018

Thanks, @tiennou!

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