Skip to content

Commit 6128301

Browse files
pks-tgitster
authored andcommitted
meson: fix OpenSSL fallback when not explicitly required
When OpenSSL isn't provided by the system we know to fall back to the subproject wrapper. This is especially helpful on Windows systems, where you typically don't have OpenSSL available, in order to reduce the number of required dependencies. The fallback is broken though when the OpenSSL backend is set to 'auto' as we end up calling `dependency('openssl', required: false)` in that case, which implicitly disables falling back to the wrapper. Fix the issue by re-allowing the fallback in case either OpenSSL is required or in case the backend is set to 'auto'. While at it, fix reporting of the backend in case the user asked us to pick no HTTPS backend at all. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent bd262d0 commit 6128301

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

meson.build

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1352,7 +1352,11 @@ if https_backend == 'auto' and security_framework.found()
13521352
endif
13531353

13541354
openssl_required = 'openssl' in [csprng_backend, https_backend, sha1_backend, sha1_unsafe_backend, sha256_backend]
1355-
openssl = dependency('openssl', required: openssl_required, default_options: ['default_library=static'])
1355+
openssl = dependency('openssl',
1356+
required: openssl_required,
1357+
allow_fallback: openssl_required or https_backend == 'auto',
1358+
default_options: ['default_library=static'],
1359+
)
13561360
if https_backend == 'auto' and openssl.found()
13571361
https_backend = 'openssl'
13581362
endif
@@ -1366,6 +1370,7 @@ elif https_backend == 'openssl'
13661370
else
13671371
# We either couldn't find any dependencies with 'auto' or the user requested
13681372
# 'none'. Both cases are benign.
1373+
https_backend = 'none'
13691374
endif
13701375

13711376
if https_backend != 'openssl'

0 commit comments

Comments
 (0)