diff --git a/bindings/matrix-sdk-ffi/Cargo.toml b/bindings/matrix-sdk-ffi/Cargo.toml index 4ca3307e2e4..18d465de369 100644 --- a/bindings/matrix-sdk-ffi/Cargo.toml +++ b/bindings/matrix-sdk-ffi/Cargo.toml @@ -13,8 +13,11 @@ repository = "https://github.com/matrix-org/matrix-rust-sdk" crate-type = ["cdylib", "staticlib"] [features] -default = ["bundled-sqlite"] +default = ["bundled-sqlite", "rustls-tls"] + bundled-sqlite = ["matrix-sdk/bundled-sqlite"] +native-tls = ["matrix-sdk/native-tls"] +rustls-tls = ["matrix-sdk/rustls-tls"] [build-dependencies] uniffi = { workspace = true, features = ["build"] } @@ -29,6 +32,7 @@ eyeball-im = { workspace = true } extension-trait = "1.0.1" futures-core = { workspace = true } futures-util = { workspace = true } +matrix-sdk = { workspace = true, features = ["anyhow", "e2e-encryption", "experimental-oidc", "experimental-sliding-sync", "experimental-widgets", "markdown", "socks", "sqlite", "uniffi"] } matrix-sdk-ui = { workspace = true, features = ["e2e-encryption", "uniffi"] } mime = "0.3.16" once_cell = { workspace = true } @@ -56,33 +60,3 @@ language-tags = "0.3.2" [target.'cfg(target_os = "android")'.dependencies] log-panics = { version = "2", features = ["with-backtrace"] } paranoid-android = "0.2.1" - -[target.'cfg(target_os = "android")'.dependencies.matrix-sdk] -workspace = true -features = [ - "anyhow", - "e2e-encryption", - "experimental-oidc", - "experimental-sliding-sync", - "experimental-widgets", - "markdown", - "rustls-tls", # note: differ from block below - "socks", - "sqlite", - "uniffi", -] - -[target.'cfg(not(target_os = "android"))'.dependencies.matrix-sdk] -workspace = true -features = [ - "anyhow", - "e2e-encryption", - "experimental-oidc", - "experimental-sliding-sync", - "experimental-widgets", - "markdown", - "native-tls", # note: differ from block above - "socks", - "sqlite", - "uniffi", -] diff --git a/crates/matrix-sdk/build.rs b/crates/matrix-sdk/build.rs index 1d43df86adb..3c861771178 100644 --- a/crates/matrix-sdk/build.rs +++ b/crates/matrix-sdk/build.rs @@ -25,10 +25,6 @@ fn main() { native_tls_set || rustls_tls_set, "one of the features 'native-tls' or 'rustls-tls' must be enabled", ); - ensure( - !native_tls_set || !rustls_tls_set, - "only one of the features 'native-tls' or 'rustls-tls' can be enabled", - ); let is_wasm = env::var_os("CARGO_CFG_TARGET_ARCH").is_some_and(|arch| arch == "wasm32"); if is_wasm {