Skip to content

Commit

Permalink
Add Python bindings uniffi config
Browse files Browse the repository at this point in the history
  • Loading branch information
MatMaul committed Sep 2, 2024
1 parent 9edca06 commit 8ed6ca8
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 3 deletions.
3 changes: 2 additions & 1 deletion bindings/matrix-sdk-crypto-ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ license = "Apache-2.0"
publish = false

[lib]
name = "matrix_sdk_crypto_ffi"
crate-type = ["cdylib", "staticlib"]

[[bin]]
name = "matrix_sdk_crypto_ffi"
name = "uniffi-bindgen"
path = "uniffi-bindgen.rs"

[features]
Expand Down
3 changes: 3 additions & 0 deletions bindings/matrix-sdk-crypto-ffi/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["maturin>=1.0,<2.0"]
build-backend = "maturin"
3 changes: 3 additions & 0 deletions bindings/matrix-sdk-crypto-ffi/uniffi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ cdylib_name = "matrix_sdk_crypto_ffi"

[bindings.swift]
module_name = "MatrixSDKCrypto"

[bindings.python]
cdylib_name = "matrix_sdk_crypto_ffi"
7 changes: 6 additions & 1 deletion bindings/matrix-sdk-ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@ rust-version = { workspace = true }
repository = "https://github.com/matrix-org/matrix-rust-sdk"

[lib]
name = "matrix_sdk_ffi"
crate-type = ["cdylib", "staticlib"]

[[bin]]
name = "uniffi-bindgen"
path = "uniffi-bindgen.rs"

[features]
default = ["bundled-sqlite"]
bundled-sqlite = ["matrix-sdk/bundled-sqlite"]
Expand Down Expand Up @@ -41,7 +46,7 @@ tracing-core = { workspace = true }
tracing-subscriber = { workspace = true, features = ["env-filter"] }
tracing-appender = { version = "0.2.2" }
tokio = { workspace = true, features = ["rt-multi-thread", "macros"] }
uniffi = { workspace = true, features = ["tokio"] }
uniffi = { workspace = true, features = ["cli", "tokio"] }
url = { workspace = true }
zeroize = { workspace = true }
uuid = { version = "1.4.1", features = ["v4"] }
Expand Down
3 changes: 3 additions & 0 deletions bindings/matrix-sdk-ffi/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["maturin>=1.0,<2.0"]
build-backend = "maturin"
3 changes: 3 additions & 0 deletions bindings/matrix-sdk-ffi/uniffi-bindgen.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
uniffi::uniffi_bindgen_main()
}
5 changes: 4 additions & 1 deletion bindings/matrix-sdk-ffi/uniffi.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
[bindings.kotlin]
package_name = "org.matrix.rustcomponents.sdk"
cdylib_name = "matrix_sdk_ffi"
android_cleaner = true
android_cleaner = true

[bindings.python]
cdylib_name = "matrix_sdk_ffi"

0 comments on commit 8ed6ca8

Please sign in to comment.