From: Jonathan Dieter Date: Thu, 2 Aug 2018 10:59:41 +0000 (+0100) Subject: Make backwards compatible with 0.44+ X-Git-Tag: archive/raspbian/1.1.9+ds1-1+rpi1~1^2~138 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=46776dca197140479919f1baefa59c5bcd38f9c2;p=zchunk.git Make backwards compatible with 0.44+ Signed-off-by: Jonathan Dieter --- 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')