Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix building 'gcs' feature on Windows and add OpenSSL static linking instructions. #306

Merged
merged 2 commits into from
Oct 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ all-windows = ["redis", "s3", "memcached", "azure"]
azure = ["chrono", "hyper", "rust-crypto", "url"]
s3 = ["chrono", "hyper", "reqwest", "rust-crypto", "simple-s3"]
simple-s3 = []
gcs = ["chrono", "hyper", "jsonwebtoken", "openssl", "url"]
gcs = ["chrono", "hyper", "jsonwebtoken", "openssl", "reqwest", "url"]
memcached = ["memcached-rs"]
# Enable features that require unstable features of Nightly Rust.
unstable = []
Expand Down
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,17 @@ rustflags = ["-Ctarget-feature=+crt-static"]

Build with `cargo` and use `dumpbin /dependents` to check that the resulting binary does not depend on MSVC CRT DLLs anymore.

In order to statically link against both the CRT and OpenSSL, you will need to build OpenSSL with a statically linked CRT, which is left as an exercise for the reader. Generally it is simpler to just ship the OpenSSL DLLs.
In order to statically link against both the CRT and OpenSSL, you will need to either build OpenSSL static libraries (with a statically linked CRT) yourself or get a pre-built distribution that provides these.

Then you can set environment variables which get picked up by the `openssl-sys` crate.

See the following example for using pre-built libraries from [Shining Light Productions](https://slproweb.com/products/Win32OpenSSL.html), assuming an installation in `C:\OpenSSL-Win64`:

```
set OPENSSL_LIB_DIR=C:\OpenSSL-Win64\lib\VC\static
set OPENSSL_INCLUDE_DIR=C:\OpenSSL-Win64\include
set OPENSSL_LIBS=libcrypto64MT:libssl64MT
```

---

Expand Down