summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-12-30 15:24:05 +0100
committerJunio C Hamano <gitster@pobox.com>2024-12-30 15:50:45 +0100
commit31eb6d7cf09c3fa668c1839d8c5759ab7cdf280c (patch)
tree8bf08ec9c96330634586cbe5310436e60debd539
parentmeson: consistenlty spell 'CommonCrypto' (diff)
downloadgit-31eb6d7cf09c3fa668c1839d8c5759ab7cdf280c.tar.xz
git-31eb6d7cf09c3fa668c1839d8c5759ab7cdf280c.zip
meson: deduplicate access to SHA1/SHA256 backend options
We've got a couple of repeated calls to `get_option()` for the SHA1 and SHA256 backend options. While not an issue, it makes the code needlessly verbose. Fix this by consistently using a local variable. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--meson.build6
1 files changed, 3 insertions, 3 deletions
diff --git a/meson.build b/meson.build
index 9da58dafe0..6fa4d900ee 100644
--- a/meson.build
+++ b/meson.build
@@ -1326,6 +1326,8 @@ if not meson.is_cross_build() and fs.exists('/dev/tty')
endif
https_backend = get_option('https_backend')
+sha1_backend = get_option('sha1_backend')
+sha256_backend = get_option('sha256_backend')
security_framework = dependency('Security', required: https_backend == 'CommonCrypto')
core_foundation_framework = dependency('CoreFoundation', required: security_framework.found())
@@ -1333,7 +1335,7 @@ if https_backend == 'auto' and security_framework.found()
https_backend = 'CommonCrypto'
endif
-openssl_required = https_backend == 'openssl' or get_option('sha1_backend') == 'openssl' or get_option('sha256_backend') == 'openssl'
+openssl_required = https_backend == 'openssl' or sha1_backend == 'openssl' or sha256_backend == 'openssl'
openssl = dependency('openssl', required: openssl_required, default_options: ['default_library=static'])
if https_backend == 'auto' and openssl.found()
https_backend = 'openssl'
@@ -1354,7 +1356,6 @@ if https_backend != 'openssl'
libgit_c_args += '-DNO_OPENSSL'
endif
-sha1_backend = get_option('sha1_backend')
if sha1_backend == 'sha1dc'
libgit_c_args += '-DSHA1_DC'
libgit_c_args += '-DSHA1DC_NO_STANDARD_INCLUDES=1'
@@ -1382,7 +1383,6 @@ else
error('Unhandled SHA1 backend ' + sha1_backend)
endif
-sha256_backend = get_option('sha256_backend')
if sha256_backend == 'openssl'
libgit_c_args += '-DSHA256_OPENSSL'
libgit_dependencies += openssl