Make backwards compatible with 0.44+
authorJonathan Dieter <jdieter@gmail.com>
Thu, 2 Aug 2018 10:59:41 +0000 (11:59 +0100)
committerJonathan Dieter <jdieter@gmail.com>
Thu, 2 Aug 2018 10:59:41 +0000 (11:59 +0100)
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
meson.build
meson_options.txt

index d5dbfc5cb3a91f97a06a36a3ea3a804f8fab98c2..22646e30f604360305a83df271651a5d31cd9107 100644 (file)
@@ -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')
index bfb4128bd37e66f7b6e87e3337cf95d83a560ab2..0f9d7c178edda34c2127b60dc8e3ef19052b5521 100644 (file)
@@ -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')