Skip to content

Commit 6d8aa2a

Browse files
pks-tgitster
authored andcommitted
meson: simplify conditions for HTTPS and SHA1 dependencies
The conditions used to figure out whteher the Security framework or OpenSSL library is required are a bit convoluted because they can be pulled in via the HTTPS, SHA1 or SHA256 backends. Refactor them to be easier to read. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d6787d9 commit 6d8aa2a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

meson.build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1329,13 +1329,13 @@ https_backend = get_option('https_backend')
13291329
sha1_backend = get_option('sha1_backend')
13301330
sha256_backend = get_option('sha256_backend')
13311331

1332-
security_framework = dependency('Security', required: https_backend == 'CommonCrypto' or sha1_backend == 'CommonCrypto')
1332+
security_framework = dependency('Security', required: 'CommonCrypto' in [https_backend, sha1_backend])
13331333
core_foundation_framework = dependency('CoreFoundation', required: security_framework.found())
13341334
if https_backend == 'auto' and security_framework.found()
13351335
https_backend = 'CommonCrypto'
13361336
endif
13371337

1338-
openssl_required = https_backend == 'openssl' or sha1_backend == 'openssl' or sha256_backend == 'openssl'
1338+
openssl_required = 'openssl' in [https_backend, sha1_backend, sha256_backend]
13391339
openssl = dependency('openssl', required: openssl_required, default_options: ['default_library=static'])
13401340
if https_backend == 'auto' and openssl.found()
13411341
https_backend = 'openssl'

0 commit comments

Comments
 (0)