]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
build: Use Feature option for OpenSSL
authorDaniel Wagner <dwagner@suse.de>
Mon, 20 Dec 2021 16:02:19 +0000 (17:02 +0100)
committerDaniel Wagner <dwagner@suse.de>
Mon, 20 Dec 2021 16:02:19 +0000 (17:02 +0100)
Simplify the OpenSSL logic by using meson's Feature option.

Suggested-by: Eli Schwartz <eschwartz93@gmail.com>
Signed-off-by: Daniel Wagner <dwagner@suse.de>
meson.build
meson_options.txt

index 4cdbdcea688bc566b19c477cd691a1f4ae10cf1f..b2904bbaf630af715f14095646afd010fe3dcde6 100644 (file)
@@ -57,17 +57,10 @@ conf.set('LIBHUGETLBFS', have_libhugetlbfs, description: 'Is libhugetlbfs availa
 libz_dep = dependency('zlib', fallback : ['zlib', 'zlib_dep'])
 
 # Check for OpenSSL availability
-want_openssl = get_option('openssl')
-if want_openssl != 'false'
-  openssl_dep = dependency('openssl', version: '>=1.1.0',
-                           required: want_openssl == 'true',
-                           fallback : ['openssl', 'openssl_dep'])
-  have_openssl = openssl_dep.found()
-else
-  openssl_dep = []
-  have_openssl = false
-endif
-conf.set('OPENSSL', have_openssl, description: 'Is OpenSSL available?')
+openssl_dep = dependency('openssl', version: '>=1.1.0',
+                         required: get_option('openssl'),
+                         fallback : ['openssl', 'openssl_dep'])
+conf.set('OPENSSL', openssl_dep.found(), description: 'Is OpenSSL available?')
 
 # Set the nvme-cli version
 conf.set('NVME_VERSION', '"' + meson.project_version() + '"')
index da97b8144d79ce42ac26bdd8c1cfbb65499ff802..864b1e1c2de4f8fbc46b87f8680c8a070845f05f 100644 (file)
@@ -4,4 +4,4 @@ option('systemddir', type : 'string', value : 'lib/systemd/', description : 'dir
 option('htmldir', type : 'string', value : '', description : 'directory for HTML documentation')
 
 option('docs', type : 'combo', choices : ['false', 'html', 'man', 'all'], description : 'install documentation')
-option('openssl', type : 'combo', choices : ['auto', 'true', 'false'], description : 'OpenSSL support')
+option('openssl', type : 'feature', value: 'auto', description : 'OpenSSL support')