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 @@ + + + + + + + + +

Allow explicit disabling of optional dependencies in meson builds.

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