aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Harrison <adamdharrison@gmail.com>2023-10-10 11:32:06 -0400
committerAdam Harrison <adamdharrison@gmail.com>2023-10-10 11:32:06 -0400
commit3d4390468181af1e329ba93c9776c906f63b8478 (patch)
tree2e74b35f7b19b7ec5caf38fddcddab953647986e
parent87823238841b47df4c91e5c8faad03806bcc5cc6 (diff)
parentd6650d1687b84d9f78129f1edcb1339cc5fa512b (diff)
downloadlite-xl-plugin-manager-3d4390468181af1e329ba93c9776c906f63b8478.tar.gz
lite-xl-plugin-manager-3d4390468181af1e329ba93c9776c906f63b8478.zip
Merge branch 'master' of github.com:adamharrison/lite-xl-plugin-manager
-rw-r--r--meson.build23
1 files changed, 17 insertions, 6 deletions
diff --git a/meson.build b/meson.build
index 32664cc..eed1d7a 100644
--- a/meson.build
+++ b/meson.build
@@ -8,18 +8,29 @@ project('lpm',
cc = meson.get_compiler('c')
zlib_dep = dependency('zlib')
-mbedtls_dep = dependency('mbedtls', required: false)
+mbedtls_dep = dependency('mbedtls', version: '<3', required: false)
libgit2_dep = dependency('libgit2')
libzip_dep = dependency('libzip')
lua_dep = dependency('lua')
microtar_dep = dependency('microtar', required: false)
if not mbedtls_dep.found()
- mbedtls_dep = [
- cc.find_library('mbedtls'),
- cc.find_library('mbedx509'),
- cc.find_library('mbedcrypto'),
- ]
+ # Using has_headers to distinguish between mbedtls2 and mbedtls3
+ _mbedtls_dep = cc.find_library('mbedtls', has_headers: 'mbedtls/net.h', required: false)
+ if _mbedtls_dep.found()
+ mbedtls_dep = [
+ _mbedtls_dep,
+ cc.find_library('mbedx509'),
+ cc.find_library('mbedcrypto'),
+ ]
+ else
+ # In some cases we need to manually specify where to find mbedtls2
+ message('Using fallback mbedtls definition')
+ mbedtls_dep = declare_dependency(
+ include_directories: ['/usr/include/mbedtls2/'],
+ link_args: ['-L/usr/lib/mbedtls2', '-lmbedtls', '-lmbedx509', '-lmbedcrypto']
+ )
+ endif
endif
if not microtar_dep.found()