static: use pkg-config exclusively when using it #445
Loading…
Reference in New Issue
No description provided.
Delete Branch "exclusive-pkg-config"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When using the static linking option on platforms that use pkg-config,
use ONLY pkg-config to get the CFLAGS and LDFLAGS. This prevents pulling
in dependencies and flags for any non-vendored version that may be
present on the host.
The main practical effect of this is that if someone doesn't need/want
any sort of remote access support at all they can completely disable
libcurl, libssh2, libssl, etc and produce a smaller/simpler binary and
greatly simplify their build-time dependencies. When done properly, the
generated pkg-config file will tell cgo everything it needs to know.
This also prevents confusion if there is a system copy of libgit2 that
is being given priority over the vendored build.
This patch was required to be able to do the following in my builds:
You can use
cmake --build . --target install
as inf463379110/script/cibuild.sh (L27)
@lhchavez thanks for the tip. I've incorporated it in to the PR.
The builds keep working, so it doesn't look like it breaks the existing linking types. Ta.