Static OpenSSL Linking for MacOS and Windows #278
Closed
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.
I made some
build.rs
updates to support statically linking openssl + curl on MacOS and Windows. Previously, this worked flawlessly against musl on linux, but the other platforms still required extern dependencies once compiled.I tried to keep the changes as minimal as possible, and if there is a better way to accomplish this please just let me know.
I use
curl-rust
in production and have to support many platforms. Sometimes we run into old XP systems that don't support TLS natively and thus statically bringing openssl in a fat binary is the only way to achieve communications. Similarly on MacOS, I'm not able to guarantee the presence or version of a dynamically linked openssl version on the host.I used the example app from the README and this feature set to produce binaries for windows and MacOS to verify the changes work.
Note: originally i had introduced a completely separate feature flag for forcing this as to leave the current behavior in tact. I decided against it eventually but can definitely bring it back if so desired.