adds support for pre-existing `zstd::libzstd` which is useful for
projects that bundle their own zstd in a way that doesn't get caught by
`CONFIG`
Signed-off-by: crueter <crueter@eden-emu.dev>
* Remove 32-bit limitation
* Fix build problems
* Add 32-bit disclaimer and fix MSVC x86 warnings
- Move 32-bit warning to top of README with strong disclaimer
- Add static_cast<size_t> to fix truncation warnings on 32-bit MSVC
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* [CMake] New component MbedTLS
New component MbedTLS.
* Fix case
Fix case: HTTPLIB_REQUIRE_OPENSSL=OFF; HTTPLIB_REQUIRE_MBEDTLS=ON
* [CMake] Test target MbedTLS::tfpsacrypto
[CMake] Test target MbedTLS::tfpsacrypto.
* [CMake] Test MbedTLS::mbedx509
[CMake] Test MbedTLS::mbedx509.
* Revert "[CMake] Test MbedTLS::mbedx509"
This reverts commit 1d0b91f59a.
* Revert "[CMake] Test target MbedTLS::tfpsacrypto"
This reverts commit bf099f6264.
* Fix problem caused by the recent performance improvement
* wolfSSL support
wolfSSL support.
Partly solve https://github.com/yhirose/cpp-httplib/issues/2371. Only
meson is missing.
* Solve https://github.com/yhirose/cpp-httplib/issues/2361
Solve https://github.com/yhirose/cpp-httplib/issues/2361.
Apply `WARNING`.
* Fix variable
Fix variable.
* [CMake] Solve incompatibilities with loop
Solve incompatibilities with loop.
* Fix
Fix.
* Remove debug prints
Remove debug prints.
* [CMake] Fix bug
Prevent a bug aus the required and if available libraries are checked
independently from each other. A could be chosen in required but B could
be chosen in if available and everything would pass.
* Remove debug print
Remove debug print.
* Restore change
Restore change.
---------
Co-authored-by: yhirose <yuji.hirose.bug@gmail.com>
* Add C++ modules support
* Add module examples
* Missing semicolon
* Update GitHub Actions script and create a modules updating script
* Name the unused param
* Use the guarded/direct export of header approach
* Update CMakeLists.txt
Co-authored-by: Andrea Pappacoda <andrea@pappacoda.it>
* Update CMakeLists.txt
Co-authored-by: Andrea Pappacoda <andrea@pappacoda.it>
* Split scripts into split.py and generate_module.py
---------
Co-authored-by: Andrea Pappacoda <andrea@pappacoda.it>
To avoid surprises in the projects consuming the library, don't define
BUILD_SHARED_LIBS option ourselves but just use its value, if provided,
to define HTTPLIB_SHARED option which can be also set directly to
specify whether we should build static or shared library.
Closes#2263.
* Support zstd also via pkg-config
It doesn't always provide cmake config
* Find zstd with pkg-config also in non-required case
Code by @sum01, slightly modified
* Add zstd support
* Add zstd to CI tests
* Use use zstd cmake target instead of ZSTD. Use cmake variable for found packages
* Add missing comment for HTTPLIB_REQUIRE_ZSTD
* Fix test.yaml rebase error
* Use zstd::libzstd target
* Add include and library paths to ZSTD args
* Run clang-format
* Add zstd to httplibConfig.cmake.in
* Revert "Fix typo in meson.build (#2070)"
This reverts commit 5c0135fa5d.
* Revert "build(meson): automatically use poll or select as needed (#2067)"
This reverts commit 2b5d1eea8d.
* Revert "Make poll() the default (#2065)"
This reverts commit 6e73a63153.
* Remove select() and use poll()
* Move httplibConfig.cmake.in to cmake dir
Just makes more sense to put it there I suppose.
* Cmake install README & License
Seems to make sense since you might already do this as a package
manager, or an end user might want them anyways.
The locations are just based on standard Linux locations using
GNUInstallDirs, so it should be sane on other machines too.
* Reorder cmake docs a bit
Just wanted to group the more related build options together.
Also removed a pointless reference to the old reasoning for the required
min ver since it's 3.14 now anyways.
* Fix outdated cmake comment
We don't use Git to find the version string anymore.
Just updated to match what it's actually used for now.
* Group options and build-tree vars in Cmake
Doesn't really change anything, I just wanted to clean these up a bit.
* Fix how we set HTTPLIB_IS_USING_XXX vars in Cmake
Prevents us acidentally using libs when the user didn't want them
actually used. This could happen if they set the option to OFF but their
own project itself is using the lib, thus we'd find and use it anyways.
Ref #1602 to see an example of this already happening before.
This is merely apply that kind of fix to all 3 of our deps, instead of
just OpenSSL.
* Minor formatting/comment change to Cmake
Pointless, but these things were bothering me..
We already detect OpenSSL in our tree for another project, but don't want to
link httplib against OpenSSL or with SSL support.
Allow us to `set(HTTPLIB_IS_USING_OPENSSL FALSE)`.
This allows disabling the use of C++ exceptions at CMake configure time.
The value is encoded in the generated httplibTargets.cmake file and will
be used by CMake projects that import it.
* Support loading system certs from Keychein on MacOS
* review improvements: add deps to meson.build and improve conditional expressions in cmake
* fix tabs
* fix tabs
* review improvements
* fix after review
* additionally load root certs from the system root keychain
* cmake fix
* fix
* small refactoring
* small refactoring
---------
Co-authored-by: Sergey Kazmin <sergey.kazmin@kaspersky.com>
* Add test/CMakeLists.txt to enable testing with CTest
Add HTTPLIB_TEST option
Downlaod GoogleTest source using FetchContent module
Generate cert files to test httplib with OpenSSL
* Generate cert2.pem with a new certificate request
* Use the latest GoogleTest library
Release 0.11 broke backwards compatibility, meaning that different
cpp-httplib versions are compatible with each other only if the major
and minor version numbers are the same.
This patch reflects this in the build systems.
See #1209 for some more context.
- Enable THREADS_PREFER_PTHREAD_FLAG to use -pthread where supported
- Remove low-level compile features (closes#1272)
- Remove unneeded DESTINATION options where possible
Correct the working directory of the execute_process call, to get the version from git tags.
The working directory should be the the directory of this libary. Otherwise, if you include httplib
as a git submodule and call add_subdirectory, the execute_process command will be run in a wrong
directory leading to error.
If you didn't have Git installed, execute_process never declared the
error variable, which led to it never parsing the header for a version.
So if Git wasn't installed, the version variable never got declared,
which caused errors.
This fixes that.
Had to create a custom FindBrotli package, as not all users have
PkgConfig installed (which Brotli uses). This file gets installed
alongside httplibConfig.cmake for the end-users convenience.
Set BROTLI_USE_STATIC_LIBS to ON if you want to find the static libs
instead of default shared.
Adds the HTTPLIB_REQUIRE_BROTLI (default off) and HTTPLIB_USE_BROTLI_IF_AVAILABLE
(default on) options, which work in the same manner as the other optional/required
dependency options.
Moved the scattered linking and definitions to a single call.
Updated some documentation about the new options.
Improved the in-tree support by setting the HTTPLIB_IS_USING_XYZ
variables in the main CMakeLists (as well as having them in the
httplibConfig.cmake file).
Fixes#582
Seems certain targets/hosts failed without these, as "_MSC_VER" is
undefined on MinGW, which caused the 'pragma comment(lib "libname")' to
fail.
Fixes#575
This gets us the full version (aka with the patch version), instead of
just major and minor version from user agent.
Falls back to the user agent if it fails.