From 46776dca197140479919f1baefa59c5bcd38f9c2 Mon Sep 17 00:00:00 2001 From: Jonathan Dieter Date: Thu, 2 Aug 2018 11:59:41 +0100 Subject: [PATCH] Make backwards compatible with 0.44+ Signed-off-by: Jonathan Dieter --- meson.build | 22 +++++++++++++++------- meson_options.txt | 4 ++-- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/meson.build b/meson.build index d5dbfc5..22646e3 100644 --- a/meson.build +++ b/meson.build @@ -1,6 +1,6 @@ project('zck', 'c', version : '0.9.5', - meson_version : '>=0.47.0', + meson_version : '>=0.44.0', default_options : ['c_std=gnu99']) so_version = '1' @@ -11,16 +11,24 @@ common_cflags = [ cc = meson.get_compiler('c') add_project_arguments(cc.get_supported_arguments(common_cflags), language : 'c') -zstd_dep = dependency('libzstd', required : get_option('with-zstd')) -if zstd_dep.found() - add_project_arguments('-DZCHUNK_ZSTD', language : 'c') +if get_option('with-zstd') == 'disabled' + zstd_dep = dependency('', required : false) +else + zstd_dep = dependency('libzstd', required : get_option('with-zstd') == 'enabled') + if zstd_dep.found() + add_project_arguments('-DZCHUNK_ZSTD', language : 'c') + endif endif curl_dep = dependency('libcurl') -openssl_dep = dependency('openssl', required : get_option('with-openssl')) -if openssl_dep.found() - add_project_arguments('-DZCHUNK_OPENSSL', language : 'c') +if get_option('with-openssl') == 'disabled' + openssl_dep = dependency('', required : false) +else + openssl_dep = dependency('openssl', required : get_option('with-openssl') == 'enabled') + if openssl_dep.found() + add_project_arguments('-DZCHUNK_OPENSSL', language : 'c') + endif endif inc = include_directories('include') diff --git a/meson_options.txt b/meson_options.txt index bfb4128..0f9d7c1 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,2 +1,2 @@ -option('with-zstd', type : 'feature', value : 'auto') -option('with-openssl', type : 'feature', value : 'auto') +option('with-zstd', type : 'combo', choices : ['enabled', 'disabled', 'auto'], value : 'auto') +option('with-openssl', type : 'combo', choices : ['enabled', 'disabled', 'auto'], value : 'auto') -- 2.30.2