Skip to content

Commit cb32b01

Browse files
authored
Merge pull request #1073 from ilyagr/patch-1
README: document when libgit2 is statically linked
2 parents f1f09ce + 3cef411 commit cb32b01

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

README.md

+10-5
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,17 @@ stable release as well.
1919
Currently this library requires libgit2 1.7.2 (or newer patch versions). The
2020
source for libgit2 is included in the libgit2-sys crate so there's no need to
2121
pre-install the libgit2 library, the libgit2-sys crate will figure that and/or
22-
build that for you.
22+
build that for you. On the other hand, if an appropriate version of `libgit2`
23+
is present, `git2` will attempt to dynamically link it.
2324

24-
You can enable the Cargo feature `vendored-libgit2` to always compile and
25-
statically link to a copy of libgit2. Sometimes the libgit2 on the system is
26-
required to be found and used even when `vendored-libgit2` is activated. In
27-
this case, you shall set the environment variable `LIBGIT2_NO_VENDOR=1`.
25+
To be more precise, the vendored `libgit2` is linked statically if two
26+
conditions both hold:
27+
28+
- The enviornment variable `LIBGIT2_NO_VENDOR=1` is **not** set
29+
- **and** either a) The Cargo feature `vendored-libgit2` is set or b) an
30+
appropriate version of `libgit2` cannot be found on the system.
31+
32+
In particular, note that the environment variable overrides the Cargo feature.
2833

2934
## Building git2-rs
3035

0 commit comments

Comments
 (0)