From 0fc18def0f4500793b81132b57cc815dfad313cc Mon Sep 17 00:00:00 2001 From: Jean-Francois Simoneau Date: Mon, 8 Dec 2025 12:00:51 -0500 Subject: [PATCH 1/2] Add Zstd support through meson --- meson.build | 6 ++++++ meson_options.txt | 1 + 2 files changed, 7 insertions(+) diff --git a/meson.build b/meson.build index 7e95bdea96..14aab1ade0 100644 --- a/meson.build +++ b/meson.build @@ -74,6 +74,12 @@ if brotli_found_all args += '-DCPPHTTPLIB_BROTLI_SUPPORT' endif +zstd_dep = dependency('libzstd', required: get_option('zstd')) +if zstd_dep.found() + deps += zstd_dep + args += '-DCPPHTTPLIB_ZSTD_SUPPORT' +endif + async_ns_opt = get_option('non_blocking_getaddrinfo') if host_machine.system() == 'windows' diff --git a/meson_options.txt b/meson_options.txt index deff537547..7447d8d1c2 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -5,6 +5,7 @@ option('openssl', type: 'feature', value: 'auto', description: 'Enable OpenSSL support') option('zlib', type: 'feature', value: 'auto', description: 'Enable zlib support') option('brotli', type: 'feature', value: 'auto', description: 'Enable Brotli support') +option('zstd', type: 'feature', value: 'auto', description: 'Enable zstd support') option('macosx_keychain', type: 'feature', value: 'auto', description: 'Enable loading certs from the Keychain on Apple devices') option('non_blocking_getaddrinfo', type: 'feature', value: 'auto', description: 'Enable asynchronous name lookup') option('compile', type: 'boolean', value: false, description: 'Split the header into a compilable header & source file (requires python3)') From 9eb221434cf04c09b737fd40ceeb984ac79bf51c Mon Sep 17 00:00:00 2001 From: Jean-Francois Simoneau Date: Mon, 8 Dec 2025 12:30:29 -0500 Subject: [PATCH 2/2] Add libzstd-dev to abitest --- .github/workflows/abidiff.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/abidiff.yaml b/.github/workflows/abidiff.yaml index 186e4fcc8b..84ead93d3c 100644 --- a/.github/workflows/abidiff.yaml +++ b/.github/workflows/abidiff.yaml @@ -29,6 +29,7 @@ jobs: git libbrotli-dev libssl-dev + libzstd-dev meson pkg-config python3