Add feature flag for rustls

Signed-off-by: Tilo Spannagel <development@tilosp.de>
master
Tilo Spannagel 2020-08-21 18:32:15 +02:00
parent 176181bdcf
commit 5f10f4301c
2 changed files with 15 additions and 3 deletions

View File

@ -15,11 +15,13 @@ features = ["docs"]
rustdoc-args = ["--cfg", "feature=\"docs\""] rustdoc-args = ["--cfg", "feature=\"docs\""]
[features] [features]
default = ["encryption", "sqlite_cryptostore", "messages"] default = ["encryption", "sqlite_cryptostore", "messages", "native-tls"]
messages = ["matrix-sdk-base/messages"] messages = ["matrix-sdk-base/messages"]
encryption = ["matrix-sdk-base/encryption", "dashmap"] encryption = ["matrix-sdk-base/encryption", "dashmap"]
sqlite_cryptostore = ["matrix-sdk-base/sqlite_cryptostore"] sqlite_cryptostore = ["matrix-sdk-base/sqlite_cryptostore"]
native-tls = ["reqwest/native-tls"]
rustls-tls = ["reqwest/rustls-tls"]
docs = ["encryption", "sqlite_cryptostore", "messages"] docs = ["encryption", "sqlite_cryptostore", "messages"]
@ -27,8 +29,6 @@ docs = ["encryption", "sqlite_cryptostore", "messages"]
async-trait = "0.1.38" async-trait = "0.1.38"
dashmap = { version = "3.11.10", optional = true } dashmap = { version = "3.11.10", optional = true }
http = "0.2.1" http = "0.2.1"
# FIXME: Revert to regular dependency once 0.10.8 or 0.11.0 is released
reqwest = { git = "https://github.com/seanmonstar/reqwest", rev = "cff487ff58630cf0ac59f3e46cbf20cf50a28b3f" }
serde_json = "1.0.57" serde_json = "1.0.57"
thiserror = "1.0.20" thiserror = "1.0.20"
tracing = "0.1.19" tracing = "0.1.19"
@ -42,6 +42,12 @@ version = "0.1.0"
path = "../matrix_sdk_base" path = "../matrix_sdk_base"
default_features = false default_features = false
# FIXME: Revert to regular dependency once 0.10.8 or 0.11.0 is released
[dependencies.reqwest]
git = "https://github.com/seanmonstar/reqwest"
rev = "cff487ff58630cf0ac59f3e46cbf20cf50a28b3f"
default_features = false
[dependencies.tracing-futures] [dependencies.tracing-futures]
version = "0.2.4" version = "0.2.4"
default-features = false default-features = false

View File

@ -37,6 +37,12 @@
)] )]
#![cfg_attr(feature = "docs", feature(doc_cfg))] #![cfg_attr(feature = "docs", feature(doc_cfg))]
#[cfg(not(any(feature = "native-tls", feature = "rustls-tls",)))]
compile_error!("one of 'native-tls' or 'rustls-tls' features must be enabled");
#[cfg(all(feature = "native-tls", feature = "rustls-tls",))]
compile_error!("only one of 'native-tls' or 'rustls-tls' features can be enabled");
#[cfg(not(target_arch = "wasm32"))] #[cfg(not(target_arch = "wasm32"))]
pub use matrix_sdk_base::JsonStore; pub use matrix_sdk_base::JsonStore;
#[cfg(feature = "encryption")] #[cfg(feature = "encryption")]