mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-16 05:13:58 -07:00
Package cpp-httplib
Intended as replacment for mongoose, which due to license change can't be updated anymore. Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
parent
03a5198ed3
commit
9c1f133118
2 changed files with 71 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -14,6 +14,7 @@ libraries/macos
|
|||
libraries/win32
|
||||
libraries/win64
|
||||
|
||||
libraries/source/cpp-httplib/*
|
||||
libraries/source/cxxtest-4.4/*
|
||||
libraries/source/fcollada/*
|
||||
libraries/source/nvtt/*
|
||||
|
|
|
|||
70
libraries/source/cpp-httplib/build.sh
Executable file
70
libraries/source/cpp-httplib/build.sh
Executable file
|
|
@ -0,0 +1,70 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
: "${TAR:=tar}"
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
PV=0.30.1
|
||||
LIB_VERSION=${PV}+wfg0
|
||||
|
||||
fetch()
|
||||
{
|
||||
curl -fLo "cpp-httplib-${PV}.tar.gz" \
|
||||
"https://github.com/yhirose/cpp-httplib/archive/refs/tags/v${PV}.tar.gz"
|
||||
}
|
||||
|
||||
while [ "$#" -gt 0 ]; do
|
||||
case "$1" in
|
||||
--fetch-only)
|
||||
fetch
|
||||
exit
|
||||
;;
|
||||
--force-rebuild) rm -f .already-built ;;
|
||||
*)
|
||||
echo "Unknown option: $1"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
echo "Building cpp-httplib..."
|
||||
if [ -e .already-built ] && [ "$(cat .already-built || true)" = "${LIB_VERSION}" ]; then
|
||||
echo "Skipping - already built (use --force-rebuild to override)"
|
||||
exit
|
||||
fi
|
||||
|
||||
# fetch
|
||||
if [ ! -e "cpp-httplib-${PV}.tar.gz" ]; then
|
||||
fetch
|
||||
fi
|
||||
|
||||
# unpack
|
||||
rm -Rf "cpp-httplib-${PV}"
|
||||
"${TAR}" -xf "cpp-httplib-${PV}.tar.gz"
|
||||
|
||||
# configure
|
||||
rm -Rf build
|
||||
cmake -B build -S "cpp-httplib-${PV}" \
|
||||
-DBUILD_SHARED_LIBS=NO \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_LIBDIR=lib \
|
||||
-DCMAKE_INSTALL_PREFIX="$(realpath .)" \
|
||||
-DHTTPLIB_COMPILE=YES \
|
||||
-DHTTPLIB_REQUIRE_BROTLI=NO \
|
||||
-DHTTPLIB_REQUIRE_OPENSSL=NO \
|
||||
-DHTTPLIB_REQUIRE_ZLIB=NO \
|
||||
-DHTTPLIB_USE_BROTLI_IF_AVAILABLE=NO \
|
||||
-DHTTPLIB_USE_OPENSSL_IF_AVAILABLE=NO \
|
||||
-DHTTPLIB_USE_ZLIB_IF_AVAILABLE=NO \
|
||||
-DHTTPLIB_USE_ZSTD_IF_AVAILABLE=NO
|
||||
|
||||
# build
|
||||
cmake --build build
|
||||
|
||||
# install
|
||||
rm -Rf include lib share
|
||||
cmake --install build
|
||||
|
||||
echo "${LIB_VERSION}" >.already-built
|
||||
Loading…
Reference in a new issue