mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-04-11 19:28:30 +00:00
24
meson.build
24
meson.build
@@ -39,11 +39,29 @@ endif
|
|||||||
deps = [dependency('threads')]
|
deps = [dependency('threads')]
|
||||||
args = []
|
args = []
|
||||||
|
|
||||||
openssl_dep = dependency('openssl', version: '>=3.0.0', required: get_option('openssl'))
|
if get_option('tls').allowed()
|
||||||
if openssl_dep.found()
|
tls_found = false
|
||||||
|
if get_option('tls_backend') == 'openssl'
|
||||||
|
openssl_dep = dependency('openssl', version: '>=3.0.0', required: get_option('tls'))
|
||||||
|
if openssl_dep.found()
|
||||||
deps += openssl_dep
|
deps += openssl_dep
|
||||||
args += '-DCPPHTTPLIB_OPENSSL_SUPPORT'
|
args += '-DCPPHTTPLIB_OPENSSL_SUPPORT'
|
||||||
if host_machine.system() == 'darwin'
|
tls_found = true
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
mbedtls_dep = dependency('mbedtls', required: get_option('tls'))
|
||||||
|
mbedtlsx509_dep = dependency('mbedx509', required: get_option('tls'))
|
||||||
|
mbedtlscrypto_dep = dependency('mbedcrypto', required: get_option('tls'))
|
||||||
|
if mbedtls_dep.found() and mbedtlsx509_dep.found() and mbedtlscrypto_dep.found()
|
||||||
|
deps += mbedtls_dep
|
||||||
|
deps += mbedtlsx509_dep
|
||||||
|
deps += mbedtlscrypto_dep
|
||||||
|
args += '-DCPPHTTPLIB_MBEDTLS_SUPPORT'
|
||||||
|
tls_found = true
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
if tls_found and host_machine.system() == 'darwin'
|
||||||
macosx_keychain_dep = dependency('appleframeworks', modules: ['CFNetwork', 'CoreFoundation', 'Security'], required: get_option('macosx_keychain'))
|
macosx_keychain_dep = dependency('appleframeworks', modules: ['CFNetwork', 'CoreFoundation', 'Security'], required: get_option('macosx_keychain'))
|
||||||
if macosx_keychain_dep.found()
|
if macosx_keychain_dep.found()
|
||||||
deps += macosx_keychain_dep
|
deps += macosx_keychain_dep
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: MIT
|
# SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
option('openssl', type: 'feature', value: 'auto', description: 'Enable OpenSSL support')
|
option('tls', type: 'feature', description: 'Enable TLS support')
|
||||||
|
option('tls_backend', type: 'combo', choices: ['openssl', 'mbedtls'], value: 'openssl', description: 'Which TLS library to use')
|
||||||
option('zlib', type: 'feature', value: 'auto', description: 'Enable zlib support')
|
option('zlib', type: 'feature', value: 'auto', description: 'Enable zlib support')
|
||||||
option('brotli', type: 'feature', value: 'auto', description: 'Enable Brotli support')
|
option('brotli', type: 'feature', value: 'auto', description: 'Enable Brotli support')
|
||||||
option('zstd', type: 'feature', value: 'auto', description: 'Enable zstd support')
|
option('zstd', type: 'feature', value: 'auto', description: 'Enable zstd support')
|
||||||
@@ -12,6 +13,7 @@ option('compile', type: 'boolean', value: false, description: 'Split the header
|
|||||||
option('test', type: 'boolean', value: false, description: 'Build tests')
|
option('test', type: 'boolean', value: false, description: 'Build tests')
|
||||||
|
|
||||||
# Old option names
|
# Old option names
|
||||||
|
option('openssl', type: 'feature', deprecated: 'tls')
|
||||||
option('cpp-httplib_openssl', type: 'feature', deprecated: 'openssl')
|
option('cpp-httplib_openssl', type: 'feature', deprecated: 'openssl')
|
||||||
option('cpp-httplib_zlib', type: 'feature', deprecated: 'zlib')
|
option('cpp-httplib_zlib', type: 'feature', deprecated: 'zlib')
|
||||||
option('cpp-httplib_brotli', type: 'feature', deprecated: 'brotli')
|
option('cpp-httplib_brotli', type: 'feature', deprecated: 'brotli')
|
||||||
|
|||||||
Reference in New Issue
Block a user