Link against hxcpp's mbedtls in static builds #1818
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This avoids issues with lime's mbedtls taking priority over hxcpp's, which has happened in the past and has broken haxe standard library calls. See #1767 and HaxeFoundation/hxcpp#1126.
The static lime library no longer includes mbedtls definitions. Mbedtls is now added at the end when everything is linked together. This means that if lime was linked against an incompatible version of mbedtls to what the current hxcpp version has, there will be a linker error instead of both versions being merged together silently and resulting in a buggy build. We are compiling hxcpp_ssl, which includes hxcpp's SSL.cpp but this is a small inconvenience and I think most linkers should remove the unneeded definitions. If hxcpp's xml files are reorganised, we can avoid this with future hxcpp versions (see HaxeFoundation/hxcpp#1133).
MBEDTLS_NET_C
is currently undefined by the mbedtls config for hxcpp (see HaxeFoundation/hxcpp#1128). This causes this linker errors with curl, but we can avoid it by updating to curl 7.87.0.Further work seems to still be required to get this working on iOS and android, but right now I'm not too familiar with how the builds work there.