| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
since f585b12 neither PCRE nor PCRE2 backends rely on POSIX regex, so
reflect it in library detection logic
|
| |
|
|
|
|
|
| |
Adding SHA256 support prompted an overdue refactoring of some of the
unnecessary complexity around the CNG/CryptoAPI abstraction.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Add support for a SHA256 hash algorithm, and add the "builtin" SHA256
hash engine (from RFC 6234).
|
|
|
|
|
|
| |
Remove the "generic" implementation; it should never be used; it only
existed for a no-dependencies configuration, and our bundled sha1dc
satisfies that requirement _and_ is correct.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Instead of simply including the utility files directly, make them a
cmake object library for easy reusability between other projects within
libgit2.
Now the top-level `src` is responsible for platform selection, while the
next-level `libgit2` and `util` configurations are responsible for
identifying what objects they include.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix building against system http-parser library by fixing
the find_package() argument. It seems to have been accidentally changed
from HTTPParser to HTTP_Parser in de178d36f, effectively making
the build against system library fail to find it:
```
CMake Warning at cmake/SelectHTTPParser.cmake:3 (find_package):
By not providing "FindHTTP_Parser.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"HTTP_Parser", but CMake did not find one.
Could not find a package configuration file provided by "HTTP_Parser" with
any of the following names:
HTTP_ParserConfig.cmake
http_parser-config.cmake
Add the installation prefix of "HTTP_Parser" to CMAKE_PREFIX_PATH or set
"HTTP_Parser_DIR" to a directory containing one of the above files. If
"HTTP_Parser" provides a separate development package or SDK, be sure it
has been installed.
Call Stack (most recent call first):
src/CMakeLists.txt:97 (include)
CMake Error at cmake/SelectHTTPParser.cmake:11 (message):
http-parser support was requested but not found
Call Stack (most recent call first):
src/CMakeLists.txt:97 (include)
```
|
|\
| |
| | |
Disabling setting `CMAKE_FIND_LIBRARY_SUFFIXES` on Apple platforms.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
On macOS, since Big Sur, the libraries were moved to a cache. The SDK comes
with stubs in the SDK (`/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/lib/`
or whatever SDK version one has installed) where most have the `.tbd` suffix
(although some still are `.a`). Forcing `CMAKE_FIND_LIBRARY_SUFFIXES` on Apple
platforms broke building, unless one has copies of the libraries installed
elsewhere (like Brew), as many libraries (like `iconv` or `pcre`) are not
found.
This fix disables setting the `CMAKE_FIND_LIBRARY_SUFFIXES` to `.a` if
the platform is `APPLE` when building static libs.
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Also applies to *_BINARY_DIR.
This effectively reverts 84083dcc8bd41332ccac9d7b537f3e254d79011c,
which broke all users of libgit2 that use it as a CMake subdirectory
(via `add_subdirectory()`). This is because CMAKE_SOURCE_DIR refers
to the root-most CMake directory, which in the case of
`add_subdirectory()` is a parent project to libgit2 and thus the paths
don't make any sense to the configuration files. Corollary,
CMAKE_SOURCE_DIR only makes sense if the CMake project is always the
root project - which can rarely be guaranteed.
In all honesty, CMake should deprecate and eventually remove
CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR. It's been the source of headaches
and confusion for years, they're rarely useful over
CMAKE_CURRENT_(SOURCE|BINARY)_DIR or PROJECT_(SOURCE|BINARY)_DIR,
and they cause a lot of confusing configuration and source
code layouts to boot.
Any time they are used, they break `add_subdirectory()` almost 100% of
the time, cause confusing error messages, and hide subtle bugs.
|
|
|
|
|
|
| |
Instead of using the project-specific `libgit2_SOURCE_DIR` and
`libgit2_BINARY_DIR` variables, use `CMAKE_SOURCE_DIR` and
`CMAKE_BINARY_DIR`.
|
| |
|
|
|
|
|
| |
The select hashes module selects the hash; the CMakeLists.txt selects
the files to implement it.
|
|
|
|
|
| |
Update the global variables `LIBGIT2_OBJECTS` to
`LIBGIT2_DEPENDENCY_OBJECTS` for clarity and consistency.
|
|
|
|
| |
Apply the standard project cmake formatting to the modules.
|
|
|
|
|
| |
We should enforce declarations throughout the code-base, including
examples, fuzzers and tests, not just in the `src` tree.
|
|
|
|
| |
Move zlib selection into its own cmake module.
|
|
|
|
| |
Move WinHTTP selection into its own cmake module.
|
|
|
|
| |
Move SSH selection into its own cmake module.
|
|
|
|
| |
Move regex selection into its own cmake module.
|
|
|
|
| |
Move http_parser selection into its own cmake module.
|
| |
|
| |
|
|
|
|
|
| |
WinHTTP can now be disabled with `USE_WINHTTP=OFF` instead of
`WINHTTP=OFF` to better support the other cmake semantics.
|
|
|
|
|
|
|
|
| |
Threading can now be disabled with `USE_THREADS=OFF` instead of
`THREADSAFE=OFF` to better support the other cmake semantics.
Nanosecond support is the default _if_ we can detect it. This should be
our default always - like threads - and people can opt out explicitly.
|
|
|
|
|
|
| |
in #6083 the test runner was renamed to libgit2_tests,
but not all references to the old name were updated.
this change changes all of them to use the new name.
|
| |
|
|
|
| |
Co-authored-by: Edward Thomson <ethomson@github.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Provide an interface around OpenSSL to dynamically load the libraries
and symbols, so that users can distribute a libgit2 library that is not
linked directly against OpenSSL. This enables users to target multiple
distributions with a single binary.
This mechanism is optional and disabled by default. Configure cmake
with -DUSE_HTTPS=OpenSSL-Dynamic to use it.
|
| |
|
|
|
|
|
|
|
|
|
| |
In the past, we've imported the CheckPrototypeDefinition into our own
module directory as it wasn't yet available in all supported CMake
versions. Now that we require at least CMake v3.5, we don't need to
bundle it anymore as it's included with the distribution already.
Let's drop the included modules and always use upstream's version.
|
|
|
|
|
|
|
|
| |
Our custom CMake module currently live in "cmake/Modules". As the
"cmake/" directory doesn't contain anything except the "Modules"
directory, it doesn't really make sense to have the additional
intermediate directory. So let's instead move the modules one level up
into the "cmake/" top level directory.
|
|
|
|
|
|
|
|
|
|
|
| |
We currently use `FILE(GLOB ...)` in most places to find source and
header files. This is problematic in that the order of files returned
depends on the operating system's directory iteration order and may thus
not be deterministic. As a result, we link object files in unspecified
order, which may cause the linker to emit different code across runs.
Fix this issue by sorting all code used as input to the libgit2 library
to improve the reliability of reproducible builds.
|
|
|
|
|
|
|
| |
We're currently doing unnecessary work to auto-detect backends even if
the functionality is disabled altogether. Let's fix this by removing the
extraneous FOO_BACKEND variables, instead letting auto-detection modify
the variable itself.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We currently hand-code logic to configure where to install our artifacts
via the `LIB_INSTALL_DIR`, `INCLUDE_INSTALL_DIR` and `BIN_INSTALL_DIR`
variables. This is reinventing the wheel, as CMake already provide a way
to do that via `CMAKE_INSTALL_<DIR>` paths, e.g. `CMAKE_INSTALL_LIB`.
This requires users of libgit2 to know about the discrepancy and will
require special hacks for any build systems that handle these variables
in an automated way. One such example is Gentoo Linux, which sets up
these paths in both the cmake and cmake-utils eclass.
So let's stop doing that: the GNUInstallDirs module handles it in a
better way for us, especially so as the actual values are dependent on
CMAKE_INSTALL_PREFIX. This commit removes our own set of variables and
instead refers users to use the standard ones.
As a second benefit, this commit also fixes our pkgconfig generation to
use the GNUInstallDirs module. We had a bug there where we ignored the
CMAKE_INSTALL_PREFIX when configuring the libdir and includedir keys, so
if libdir was set to "lib64", then libdir would be an invalid path. With
GNUInstallDirs, we can now use `CMAKE_INSTALL_FULL_LIBDIR`, which
handles the prefix for us.
|
|\
| |
| | |
CMake booleans
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Starting with our conversions to mix backend-autodetection and selection
into a single variable (USE_GSSAPI, USE_HTTPS, USE_SHA1), we have
introduced a simple STREQUAL to check for "ON", which indicates that the
user wants us to auto-detect available backends and pick any one that's
available. This behaviour deviates from previous behaviour, as passing a
value like "yes", "on" or "true" will in fact be treated like a backend
name and result in autodetection failure.
Fix the issue by introducing a new function `SanitizeBool`. Given a
variable that may hold a boolean value, the function will sanitize that
variable to hold either "ON" or "OFF". In case it is not a recognized
boolean, we will just keep the value as-is. This fixes the above
described issue.
|
|/
|
|
|
|
|
|
| |
Remove using custom PKG_BUILD_PREFIu, PKG_BUILD_LIBDIR and
PKG_BUILD_INCLUDEDIR variables.
Use cmake CMAKE_INSTALL_PREFIX, LIB_INSTALL_DIR, INCLUDE_INSTALL_DIR instead.
This patch fixes install libgit2.pc file in correct location and simpifies
cmake module.
|
|
|
|
|
|
| |
When USE_GSSAPI=OFF, still show information about what SPNEGO is, even
though it's disabled. This is for parity with other disabled features
like SSH and debugpool that still show details about what is disabled.
|
|\
| |
| | |
macOS GSS Support
|
| | |
|
|/
|
|
|
|
|
|
| |
LIBRARIES is the (absolute?) path to the library.
LDFLAGS is the full linker stanza to correctly link with this lib.
By passing LIBRARIES as LIBGIT_LIBS, the linker ends up with the
absolute path for the SDK'ed version of CoreFoundation (which doesn't
exist), instead of the familiar `-framework CoreFoundation`.
|
|\
| |
| | |
regexp: implement a new regular expression API
|