From 79ab72292a54dc77c739b7abdee307549cacd527 Mon Sep 17 00:00:00 2001 From: Andrei Alexeyev Date: Wed, 14 Dec 2022 07:35:51 +0100 Subject: [PATCH] build: featurize use_libcrypto --- meson.build | 3 ++- meson_options.txt | 4 ++-- src/util/meson.build | 12 +----------- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/meson.build b/meson.build index aec481d1..a7dd5820 100644 --- a/meson.build +++ b/meson.build @@ -175,7 +175,7 @@ dep_zlib = dependency('zlib', required : t dep_zstd = dependency('libzstd', version : '>=1.4.0', required : true) dep_zip = dependency('libzip', version : '>=1.5.0', required : opt_vfs_zip) dep_cglm = dependency('cglm', version : '>=0.7.8', required : true) -dep_crypto = dependency('libcrypto', required : false) +dep_crypto = dependency('libcrypto', required : get_option('use_libcrypto')) dep_gamemode = dependency('gamemode', required : false) dep_m = cc.find_library('m', required : false) @@ -187,6 +187,7 @@ dep_koishi = subproject('koishi').get_variable('koishi_dep') taisei_deps = [ dep_basisu_transcoder, dep_cglm, + dep_crypto, dep_freetype, dep_gamemode, dep_koishi, diff --git a/meson_options.txt b/meson_options.txt index 9e23bd02..d4041e7f 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -192,8 +192,8 @@ option( option( 'use_libcrypto', - type : 'combo', - choices : ['auto', 'true', 'false'], + type : 'feature', + deprecated : {'true' : 'enabled', 'false' : 'disabled'}, description : 'Use libcrypto from OpenSSL for better SHA implementations' ) diff --git a/src/util/meson.build b/src/util/meson.build index f1083bf3..a3688bb7 100644 --- a/src/util/meson.build +++ b/src/util/meson.build @@ -29,18 +29,8 @@ config.set('TAISEI_BUILDCONF_USE_DESIGNATED_INIT', cc.compiles( args : ['-Wattributes', '-Werror'] )) -use_libcrypto = get_option('use_libcrypto') - -if use_libcrypto == 'auto' - use_libcrypto = dep_crypto.found() -else - use_libcrypto = (use_libcrypto == 'true') -endif - -if use_libcrypto - assert(dep_crypto.found(), 'use_libcrypto forced but libcrypto not found. Install OpenSSL or disable use_libcrypto.') +if dep_crypto.found() util_src += files('sha256_openssl.c') - util_deps += [dep_crypto] else util_src += files('sha256.c') endif