497 Commits

Author SHA1 Message Date
Edward Thomson
84083dcc8b cmake: use CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR
Instead of using the project-specific `libgit2_SOURCE_DIR` and
`libgit2_BINARY_DIR` variables, use `CMAKE_SOURCE_DIR` and
`CMAKE_BINARY_DIR`.
2021-11-22 09:27:59 -05:00
Edward Thomson
4a54d8e39e cmake: enable testing at the top level
Ensure that we `enable_testing()` at the top-level CMakeLists.txt or
else we'll need to navigate within the build directory to the correct
place in the hierarchy to run `ctest`.  Now we can `ctest` at the
top-level again.
2021-11-17 07:27:39 -05:00
Edward Thomson
c7f6ecb391 cmake: use a string not a boolean for LIBGIT2_FILENAME 2021-11-14 07:25:41 -05:00
Edward Thomson
d3a7a352d5 cmake: move test enablement into test cmake 2021-11-11 15:56:10 -05:00
Edward Thomson
207beff541 cmake: reorganize file 2021-11-11 15:56:10 -05:00
Edward Thomson
4d2a6839dc cmake: move fuzzer args to the fuzzer's cmake 2021-11-11 15:56:10 -05:00
Edward Thomson
7b527c12bc cmake: move deprecation definition to src/
There's no need to add the deprecation at the top-level.  Our tests add
deprecation explicitly.
2021-11-11 15:56:10 -05:00
Edward Thomson
9f37457e17 cmake: move cflag defaults into a separate module 2021-11-11 15:56:10 -05:00
Edward Thomson
6c00fcb767 cmake: USE_SSH is not on by default 2021-11-11 15:56:10 -05:00
Edward Thomson
789ab91560 cmake: standardize USE_WINHTTP
WinHTTP can now be disabled with `USE_WINHTTP=OFF` instead of
`WINHTTP=OFF` to better support the other cmake semantics.
2021-11-11 15:56:10 -05:00
Edward Thomson
9324d16e73 cmake: standardize USE_THREADS and USE_NSEC
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.
2021-11-11 15:56:10 -05:00
Edward Thomson
52693ab44e cmake: stylistic refactoring
Ensure that we always use lowercase function names, and that we do not
have spaces preceding open parentheses, for consistency.
2021-10-18 08:30:14 -04:00
Edward Thomson
e1be28c7cc cmake: remove unused STDCALL option
The `STDCALL` option was removed; remove the (unreachable) error
message.
2021-10-18 08:30:14 -04:00
Edward Thomson
8507bf81ea trace: always enabled
There's no need to make tracing opt-in; it should always be included.
2021-10-18 08:30:14 -04:00
Edward Thomson
780faa41c4 cmake: allow USE_ICONV on any Unix 2021-10-18 08:30:14 -04:00
Edward Thomson
7f5b0f0c1a cmake: allow ENABLE_REPRODUCIBLE_BUILDS on macOS
macOS may support ENABLE_REPRODUCIBLE_BUILDS, allow users to opt-in to
it. (Especially since ENABLE_REPRODUCIBLE_BUILDS is not the default.)
2021-10-18 08:30:14 -04:00
Edward Thomson
4e14d4c6a6 cmake: BUILD_CLAR is now BUILD_TESTS
Nobody knows what CLAR is.  The test building option should be
`BUILD_TESTS`.
2021-10-17 13:05:32 -04:00
Edward Thomson
e7437162ff v1.3: update version number 2021-09-22 08:49:24 -04:00
Edward Thomson
c811fc361b v1.2: update version information 2021-08-31 00:19:01 -04:00
Edward Thomson
c7a195a1c4 Merge pull request #6006 from boretrk/c11-warnings
GCC C11 warnings
2021-08-25 14:11:03 -04:00
Edward Thomson
0850b1722c Merge pull request #5950 from boretrk/posixtest
open: input validation for empty segments in path
2021-08-25 12:20:50 -04:00
Peter Pettersson
b01895822f enable gcc warnings for C11 specific extensions 2021-08-25 18:07:01 +02:00
Peter Pettersson
51d69dda8c enable warnings for C11 specific extensions 2021-08-25 11:34:59 +02:00
Peter Pettersson
e96fc0283a tests: optional test for p_open() with empty path segments 2021-08-08 13:26:24 +02:00
Edward Thomson
3062a63364 cmake: extended futimens checking on macOS 2021-07-30 12:03:35 -04:00
Edward Thomson
48e6b02be9 alloc: add GIT_DEBUG_STRICT_ALLOC
Add `GIT_DEBUG_STRICT_ALLOC` to help identify problematic callers of
allocation code that pass a `0` size to the allocators and then expect a
non-`NULL` return.

When given a 0-size allocation, `malloc` _may_ return either a `NULL`
_or_ a pointer that is not writeable.  Most systems return a non-`NULL`
pointer; AIX is an outlier.  We should be able to cope with this AIXy
behavior, so this adds an option to emulate it.
2021-07-19 15:41:44 -04:00
lhchavez
754fa5263e Use an option instead of a flag for USE_BUNDLED_ZLIB
Now `USE_BUNDLED_ZLIB` can be set to the string `Chromium` to enable the
Chromium implementation of zlib.
2021-01-04 06:10:10 -08:00
lhchavez
83265b3e2c zlib: Add support for building with Chromium's zlib implementation
This change builds libgit2 using Chromium's zlib implementation by
invoking cmake with `-DUSE_BUNDLED_ZLIB=ON -DUSE_CHROMIUM_ZLIB=ON`,
which is ~10% faster than the bundled zlib for the core::zstream suite.

This version of zlib has some optimizations:

a) Decompression (Intel+ARM): inflate_fast, adler32, crc32, etc.
b) Compression (Intel): fill_window, longest_match, hash function, etc.

Due to the introduction of SIMD optimizations, and to get the maximum
performance out of this fork of zlib, this requires an x86_64 processor
with SSE4.2 and CLMUL (anything Westmere or later, ~2010). The Chromium
zlib implementation also supports ARM with NEON, but it has not been
enabled in this patch.

Performance
===========

TL;DR: Running just `./libgit2_clar -score::zstream` 100 times in a loop
took 0:56.30 before and 0:50.67 after (~10% reduction!).

The bundled and system zlib implementations on an Ubuntu Focal system
perform relatively similar (the bundled one is marginally better due to
the compiler being able to inline some functions), so only the bundled
and Chromium zlibs were compared.

For a more balanced comparison (to ensure that nothing regressed
overall), `libgit2_clar` under `perf` was also run, and the zlib-related
functions were compared.

Bundled
-------

```shell
cmake \
  -DUSE_BUNDLED_ZLIB=ON \
  -DUSE_CHROMIUM_ZLIB=OFF \
  -DCMAKE_BUILD_TYPE="RelWithDebInfo" \
  -DCMAKE_C_FLAGS="-fPIC -fno-omit-frame-pointer" \
  -GNinja \
  ..
ninja
perf record --call-graph=dwarf ./libgit2_clar
perf report --children
```

```
Samples: 87K of event 'cycles', Event count (approx.): 75923450603
  Children      Self  Command       Shared Objec  Symbol
+    4.14%     0.01%  libgit2_clar  libgit2_clar  [.] git_zstream_get_output_chunk
+    2.91%     0.00%  libgit2_clar  libgit2_clar  [.] git_zstream_get_output
+    0.69%     0.00%  libgit2_clar  libgit2_clar  [.] git_zstream_get_output (inlined)
     0.17%     0.00%  libgit2_clar  libgit2_clar  [.] git_zstream_init
     0.02%     0.00%  libgit2_clar  libgit2_clar  [.] git_zstream_reset
     0.00%     0.00%  libgit2_clar  libgit2_clar  [.] git_zstream_eos
     0.00%     0.00%  libgit2_clar  libgit2_clar  [.] git_zstream_done
     0.00%     0.00%  libgit2_clar  libgit2_clar  [.] git_zstream_free (inlined)

Samples: 87K of event 'cycles', Event count (approx.): 75923450603
  Children      Self  Command       Shared Objec  Symbol
+    3.12%     0.01%  libgit2_clar  libgit2_clar  [.] deflate
+    2.65%     1.48%  libgit2_clar  libgit2_clar  [.] deflate_slow
+    1.60%     0.55%  libgit2_clar  libgit2_clar  [.] inflate
+    0.53%     0.00%  libgit2_clar  libgit2_clar  [.] write_deflate
     0.49%     0.36%  libgit2_clar  libgit2_clar  [.] inflate_fast
     0.46%     0.02%  libgit2_clar  libgit2_clar  [.] deflate_fast
     0.19%     0.19%  libgit2_clar  libgit2_clar  [.] inflate_table
     0.16%     0.01%  libgit2_clar  libgit2_clar  [.] inflateInit_
     0.15%     0.00%  libgit2_clar  libgit2_clar  [.] inflateInit2_ (inlined)
     0.10%     0.00%  libgit2_clar  libgit2_clar  [.] deflateInit_
     0.10%     0.00%  libgit2_clar  libgit2_clar  [.] deflateInit2_
     0.03%     0.00%  libgit2_clar  libgit2_clar  [.] deflateReset (inlined)
     0.02%     0.00%  libgit2_clar  libgit2_clar  [.] deflateReset
     0.02%     0.00%  libgit2_clar  libgit2_clar  [.] inflateEnd
     0.02%     0.00%  libgit2_clar  libgit2_clar  [.] deflateEnd
     0.01%     0.00%  libgit2_clar  libgit2_clar  [.] deflateResetKeep
     0.01%     0.01%  libgit2_clar  libgit2_clar  [.] inflateReset2
     0.01%     0.00%  libgit2_clar  libgit2_clar  [.] deflateReset (inlined)
     0.00%     0.00%  libgit2_clar  libgit2_clar  [.] inflateStateCheck (inlined)
     0.00%     0.00%  libgit2_clar  libgit2_clar  [.] inflateReset (inlined)
     0.00%     0.00%  libgit2_clar  libgit2_clar  [.] inflateStateCheck (inlined)
     0.00%     0.00%  libgit2_clar  libgit2_clar  [.] deflateStateCheck (inlined)
     0.00%     0.00%  libgit2_clar  libgit2_clar  [.] inflateResetKeep (inlined)
```

Chromium
--------

```shell
cmake \
  -DUSE_BUNDLED_ZLIB=ON \
  -DUSE_CHROMIUM_ZLIB=ON \
  -DCMAKE_BUILD_TYPE="RelWithDebInfo" \
  -DCMAKE_C_FLAGS="-fPIC -fno-omit-frame-pointer" \
  -GNinja \
  ..
ninja
perf record --call-graph=dwarf ./libgit2_clar
perf report --children
```

```
Samples: 97K of event 'cycles', Event count (approx.): 80862210917
  Children      Self  Command       Shared Objec  Symbol
+    3.31%     0.00%  libgit2_clar  libgit2_clar  [.] git_zstream_get_output_chunk
+    2.27%     0.01%  libgit2_clar  libgit2_clar  [.] git_zstream_get_output
+    0.55%     0.00%  libgit2_clar  libgit2_clar  [.] git_zstream_get_output (inlined)
     0.18%     0.00%  libgit2_clar  libgit2_clar  [.] git_zstream_init
     0.02%     0.00%  libgit2_clar  libgit2_clar  [.] git_zstream_reset
     0.00%     0.00%  libgit2_clar  libgit2_clar  [.] git_zstream_free (inlined)
     0.00%     0.00%  libgit2_clar  libgit2_clar  [.] git_zstream_done
     0.00%     0.00%  libgit2_clar  libgit2_clar  [.] git_zstream_free

Samples: 97K of event 'cycles', Event count (approx.): 80862210917
  Children      Self  Command       Shared Objec  Symbol
+    2.55%     0.01%  libgit2_clar  libgit2_clar  [.] deflate
+    2.25%     1.41%  libgit2_clar  libgit2_clar  [.] deflate_slow
+    1.10%     0.52%  libgit2_clar  libgit2_clar  [.] inflate
     0.36%     0.00%  libgit2_clar  libgit2_clar  [.] write_deflate
     0.30%     0.03%  libgit2_clar  libgit2_clar  [.] deflate_fast
     0.28%     0.15%  libgit2_clar  libgit2_clar  [.] inflate_fast_chunk_
     0.19%     0.19%  libgit2_clar  libgit2_clar  [.] inflate_table
     0.17%     0.01%  libgit2_clar  libgit2_clar  [.] inflateInit_
     0.16%     0.00%  libgit2_clar  libgit2_clar  [.] inflateInit2_ (inlined)
     0.15%     0.00%  libgit2_clar  libgit2_clar  [.] deflateInit_
     0.15%     0.00%  libgit2_clar  libgit2_clar  [.] deflateInit2_
     0.11%     0.01%  libgit2_clar  libgit2_clar  [.] adler32_z
     0.09%     0.09%  libgit2_clar  libgit2_clar  [.] adler32_simd_
     0.05%     0.00%  libgit2_clar  libgit2_clar  [.] deflateReset (inlined)
     0.05%     0.00%  libgit2_clar  libgit2_clar  [.] deflate_read_buf
     0.03%     0.00%  libgit2_clar  libgit2_clar  [.] inflateEnd
     0.02%     0.00%  libgit2_clar  libgit2_clar  [.] deflateReset
     0.01%     0.00%  libgit2_clar  libgit2_clar  [.] deflateEnd
     0.01%     0.01%  libgit2_clar  libgit2_clar  [.] inflateReset2
     0.01%     0.00%  libgit2_clar  libgit2_clar  [.] inflateReset (inlined)
     0.00%     0.00%  libgit2_clar  libgit2_clar  [.] adler32
     0.00%     0.00%  libgit2_clar  libgit2_clar  [.] inflateResetKeep (inlined)
     0.00%     0.00%  libgit2_clar  libgit2_clar  [.] deflateResetKeep
     0.00%     0.00%  libgit2_clar  libgit2_clar  [.] inflateStateCheck (inlined)
     0.00%     0.00%  libgit2_clar  libgit2_clar  [.] inflateStateCheck (inlined)
     0.00%     0.00%  libgit2_clar  libgit2_clar  [.] inflateStateCheck (inlined)
     0.00%     0.00%  libgit2_clar  libgit2_clar  [.] deflateStateCheck (inlined)
```
2020-12-23 18:18:16 -08:00
Edward Thomson
8aed4629b1 cmake: rename MSVC_CRTDBG to WIN32_LEAKCHECK 2020-11-21 21:54:13 +00:00
Edward Thomson
f10c887533 Release v1.1 2020-10-12 12:03:07 +01:00
Patrick Steinhardt
19eb1e4bb7 cmake: specify project version
We currently do not set up a project version within CMake, meaning that
it can't be use by other projects including libgit2 as a sub-project and
also not by other tools like IDEs.

This commit changes this to always set up a project version, but instead
of extracting it from the "version.h" header we now set it up directly.
This is mostly to avoid mis-use of the previous `LIBGIT2_VERSION`
variables, as we should now always use the `libgit2_VERSION` ones that
are set up by CMake if one provides the "VERSION" keyword to the
`project()` call. While this is one more moving target we need to adjust
on releases, this commit also adjusts our release script to verify that
the project version was incremented as expected.
2020-07-12 14:45:47 +02:00
Patrick Steinhardt
511fb9e6f8 cmake: always disable deprecation-sync warnings
We currently disable deprecation synchronization warnings in case we're
building with Clang. We check for Clang by doing a string comparison on
the compiler identification, but this seems to have been broken by an
update in macOS' image as the compiler ID has changed to "AppleClang".
Let's just unconditionally disable this warning on Unix platforms. We
never add the deprecated attribute anyway, so the warning doesn't help
us at all.
2020-06-01 14:06:20 +02:00
Patrick Steinhardt
3956679c13 cmake: remove policies
The `CMAKE_MINIUM_REQUIRE()` function not only sets up the minimum
required CMake version of a project, but it will also at the same time
set the CMake policy version. In effect this means that all policies
that have been introduced before the minimum CMake version will be
enabled automatically.

When updating our minimum required version ebabb88f2 (cmake: update
minimum CMake version to v3.5.1, 2019-10-10), we didn't remove any of
the policies we've been manually enabling. The newest CMake policy we've
been enabling is CMP0054, which was introduced back in CMake v3.1. As a
result, we can now just remove all manual calls to `CMAKE_POLICY()`.
2020-06-01 14:06:20 +02:00
Patrick Steinhardt
2e7d457987 cmake: remove option to add profiling flags
We currently have an option that adds options for profiling to both our
CFLAGS and LDFLAGS. Having such flags behind various build options is
not really sensible at all, since users should instead set up those
flags via environment variables supported by CMake itself.

Let's remove this option.
2020-06-01 14:06:20 +02:00
Patrick Steinhardt
2551b1b067 cmake: remove support for creating tags
We currently have support for generating tags via ctags as part of our
build system. We aren't really in the place of supporting any tooling
that exists apart from the actual build environment, as doing so adds
additional complexity and maintenance burden to our build instructions.
This is in fact nicely demonstrated by this particular option, as it
hasn't been working anymore since commit e5c9723d0 (cmake: move library
build instructions into subdirectory, 2017-06-30).

As a result, this commit removes support for building CTags
2020-06-01 14:06:20 +02:00
Patrick Steinhardt
bc02bcd920 cmake: move modules into the "cmake/" top level dir
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.
2020-06-01 14:06:20 +02:00
Philip Kelley
63f9fbeea5 MSVC: Enable Control Flow Guard (CFG)
This feature requires Visual Studio 2015 (MSVC_VERSION = 1900) or later. As the
minimum required CMake version is currently less than 3.7, GREATER_EQUAL is not
available to us and we must invert the result of the LESS operator.
2020-04-25 15:44:42 -07:00
Patrick Steinhardt
87fc539f2e cmake: use install directories provided via GNUInstallDirs
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.
2020-03-14 11:18:20 +01:00
Edward Thomson
70062e28d7 version: update the version number to v0.99
This commit also switches our SOVERSION to be "$MAJOR.$MINOR" instead of
"$MINOR", only. This is in preparation of v1.0, where the previous
scheme would've stopped working in an obvious way.
2020-02-19 11:03:08 +01:00
Patrick Steinhardt
877054f39c cmake: consolidate Valgrind option
OpenSSL doesn't initialize bytes on purpose in order to generate
additional entropy. Valgrind isn't too happy about that though, causing
it to generate warninings about various issues regarding use of
uninitialized bytes.

We traditionally had some infrastructure to silence these errors in our
OpenSSL stream implementation, where we invoke the Valgrind macro
`VALGRIND_MAKE_MEMDEFINED` in various callbacks that we provide to
OpenSSL. Naturally, we only include these instructions if a preprocessor
define "VALGRIND" is set, and that in turn is only set if passing
"-DVALGRIND" to CMake. We do that in our usual Azure pipelines, but we
in fact forgot to do this in our nightly build. As a result, we get a
slew of warnings for these nightly builds, but not for our normal
builds.

To fix this, we could just add "-DVALGRIND" to our nightly builds. But
starting with commit d827b11b6 (tests: execute leak checker via CTest
directly, 2019-06-28), we do have a secondary variable that directs
whether we want to use memory sanitizers for our builds. As such, every
user wishing to use Valgrind for our tests needs to pass both options
"VALGRIND" and "USE_LEAK_CHECKER", which is cumbersome and error prone,
as can be seen by our own builds.

Instead, let's consolidate this into a single option, removing the old
"-DVALGRIND" one. Instead, let's just add the preprocessor directive if
USE_LEAK_CHECKER equals "valgrind" and remove "-DVALGRIND" from our own
pipelines.
2020-02-11 10:27:18 +01:00
Edward Thomson
625a3a49d7 trace: enable tracing by default
Tracing is meant to be extremely low-impact when not enabled.  We
currently ship no tracing calls in libgit2, but if / when we do, the
tracing infrastructure is created to skip tracing as quickly as
possible.  It should compile to a simple test when tracing is off.

Thus, there's on reason to not enable it by default.
2019-11-27 14:44:09 +11:00
Patrick Steinhardt
ebabb88f24 cmake: update minimum CMake version to v3.5.1
Back in commit cf9f34521 (cmake: bump minimum version to 2.8.11,
2017-09-06), we have bumped the minimum CMake version to require at
least v2.8.11. The main hold-backs back then were distributions like
RHEL/CentOS as well as Ubuntu Trusty, which caused us to not target a
more modern version. Nowadays, Ubuntu Trusty has been EOL'd and CentOS 6
has CMake v3.6.1 available via the EPEL6 repository, and thus it seems
fair to upgrade to a more recent version.

Going through repology [1], one can see that all supported mainstream
distributions do in fact have CMake 3 available. Going through the list,
the minimum version that is supported by all mainstream distros is in
fact v3.5.1:

	- CentOS 6 via EPEL6: 3.6.1
	- Debian Oldstable: 3.7.2
	- Fedora 26: 3.8.2
	- OpenMandriva 3.x: 3.5.1
	- Slackware 14.2: 3.5.2
	- Ubuntu 16.04: 3.5.1

Consequentally, let's upgrade CMake to the minimum version of 3.5.1 and
remove all the version CMake checks that aren't required anymore.

[1]: https://repology.org/project/cmake/versions
2019-10-10 09:42:07 +02:00
Tobias Nießen
071750a386 cmake: move _WIN32_WINNT definitions to root 2019-08-17 17:53:00 +02:00
Patrick Steinhardt
d827b11b67 tests: execute leak checker via CTest directly
Right now, we have an awful hack in our test CI setup that extracts the
test command from CTest's output and then prepends the leak checker.
This is dependent on non-machine-parseable output from CMake and also
breaks on various ocassions, like for example when we have spaces in the
current path or when the path contains backslashes. Both conditions may
easily be triggered on Win32 systems, and in fact they do break our
Azure Pipelines builds.

Remove the awful hack in favour of a new CMake build option
"USE_LEAK_CHECKER". If specifying e.g. "-DUSE_LEAK_CHECKER=valgrind",
then we will set up all tests to be run under valgrind. Like this, we
can again simply execute ctest without needing to rely on evil sourcery.
2019-07-20 19:10:10 +02:00
Edward Thomson
e61b92e00a clang: disable documentation-deprecated-sync
Add the `-Wno-documentation-deprecated-sync` switch when compiling with
clang, since our documentation adds `deprecated` markers, but we do not
add the deprecation attribute in the code itself.  (ie, the code is out
of sync with the docs).

In fact, we do not _want_ to mark these items as deprecated in the code,
at least not yet, as we are not quite ready to bother our end-users with
this since they're not going away.
2019-06-24 17:27:23 +01:00
Edward Thomson
54a60ced5c mingw: disable format specification warnings
MinGW uses gcc, which expects POSIX formatting for printf, but uses the
Windows C library, which uses its own format specifiers.  Therefore, it
gets confused about format specifiers.  Disable warnings for format
specifiers.
2019-06-24 17:27:23 +01:00
Patrick Steinhardt
393fb8a141 cmake: default NTLM client to off if no HTTPS support
If building libgit2 with `-DUSE_HTTPS=NO`, then CMake will
generate an error complaining that there's no usable HTTPS
backend for NTLM. In fact, it doesn't make sense to support NTLM
when we don't support HTTPS. So let's should just have
NTLM default to OFF when HTTPS is disabled to make life easier
and to fix our OSSFuzz builds failing.
2019-06-17 12:35:50 +02:00
Etienne Samson
94fc83b6d7 cmake: Modulize our TLS & hash detection
The interactions between `USE_HTTPS` and `SHA1_BACKEND` have been
streamlined. Previously we would have accepted not quite working
configurations (like, `-DUSE_HTTPS=OFF -DSHA1_BACKEND=OpenSSL`) and, as
the OpenSSL detection only ran with `USE_HTTPS`, the link would fail.

The detection was moved to a new `USE_SHA1`, modeled after `USE_HTTPS`,
which takes the values "CollisionDetection/Backend/Generic", to better
match how the "hashing backend" is selected, the default (ON) being
"CollisionDetection".

Note that, as `SHA1_BACKEND` is still used internally, you might need to
check what customization you're using it for.
2019-06-14 12:07:00 +02:00
Edward Thomson
fb529a01bf http-parser: use our bundled http-parser by default
Our bundled http-parser includes bugfixes, therefore we should prefer
our http-parser until such time as we can identify that the system
http-parser has these bugfixes (using a version check).

Since these bugs are - at present - minor, retain the ability for users
to force that they want to use the system http-parser anyway.  This does
change the cmake specification so that people _must_ opt-in to the new
behavior knowingly.
2019-06-13 21:24:11 +01:00
Edward Thomson
a7f65f03bd ntlm: add ntlmclient as a dependency
Include https://github.com/ethomson/ntlmclient as a dependency.
2019-06-10 19:58:22 +01:00