1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-01-04 03:49:14 +02:00

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.
This commit is contained in:
Michael Schout 2024-04-09 17:23:17 -06:00 committed by GitHub
parent dab52739cd
commit 7b95fd3bd2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 17 additions and 3 deletions

View File

@ -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"/>

View File

@ -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?')

View File

@ -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')