pgbackrest.git / summary / log / commit / refs
commit 7b95fd3bd29346e7325aa161bfee45efd71e22eb
Author: Michael Schout <schoutm@gmail.com>
Commit: GitHub <noreply@github.com>
Date: Tue Apr 09 23:23:17 2024 +0000
Allow explicit disabling of optional dependencies in meson builds.
On some platforms, e.g. FreeBSD, there is a requirement to allow the user to disable support for features even when the required library is present.
Introduce tri-state options for the optional features: auto mimics the current behavior and is the default, enable requires libraries for the feature to be present, and disable disables the feature without checking the libraries.
doc/xml/release/2024/2.52.xml | 11 +++++++++++
meson.build | 6 +++---
meson_options.txt | 3 +++
3 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/doc/xml/release/2024/2.52.xml b/doc/xml/release/2024/2.52.xml
index 664d3f8d6..d8175f0a1 100644
--- a/doc/xml/release/2024/2.52.xml
+++ b/doc/xml/release/2024/2.52.xml
@@ -1,6 +1,17 @@
<release date="XXXX-XX-XX" version="2.52dev" title="UNDER DEVELOPMENT">
<release-core-list>
<release-improvement-list>
+ <release-item>
+ <github-pull-request id="2321"/>
+
+ <release-item-contributor-list>
+ <release-item-contributor id="michael.schout"/>
+ <release-item-reviewer id="david.steele"/>
+ </release-item-contributor-list>
+
+ <p>Allow explicit disabling of optional dependencies in meson builds.</p>
+ </release-item>
+
<release-item>
<github-pull-request id="2312"/>
diff --git a/meson.build b/meson.build
index 351cce860..0ab19daaa 100644
--- a/meson.build
+++ b/meson.build
@@ -144,7 +144,7 @@ endif
lib_bz2 = cc.find_library('bz2')
# Find optional lz4 library
-lib_lz4 = dependency('liblz4', required: false)
+lib_lz4 = dependency('liblz4', required: get_option('liblz4'))
if lib_lz4.found()
configuration.set('HAVE_LIBLZ4', true, description: 'Is liblz4 present?')
@@ -168,14 +168,14 @@ lib_z = dependency('zlib')
configuration.set('ZLIB_CONST', true, description: 'Require zlib const input buffer')
# Find optional libssh2 library
-lib_ssh2 = dependency('libssh2', required: false)
+lib_ssh2 = dependency('libssh2', required: get_option('libssh2'))
if lib_ssh2.found()
configuration.set('HAVE_LIBSSH2', true, description: 'Is libssh2 present?')
endif
# Find optional zstd library
-lib_zstd = dependency('libzstd', version: '>=1.0', required: false)
+lib_zstd = dependency('libzstd', version: '>=1.0', required: get_option('libzstd'))
if lib_zstd.found()
configuration.set('HAVE_LIBZST', true, description: 'Is libzstd present?')
diff --git a/meson_options.txt b/meson_options.txt
index a2134dd61..f08aced7d 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,2 +1,5 @@
option('configdir', type: 'string', value: '/etc/pgbackrest', description: 'Configuration directory')
option('fatal-errors', type: 'boolean', value: false, description: 'Stop compilation on first error')
+option('liblz4', type: 'feature', value: 'auto', description: 'Enable LZ4 compression support')
+option('libssh2', type: 'feature', value: 'auto', description: 'Enable SFTP storage support')
+option('libzstd', type: 'feature', value: 'auto', description: 'Enable Zstandard compression support')
[parent: dab52739cd36]