release profile

This commit is contained in:
Evan Feenstra
2022-07-06 12:27:19 -07:00
parent 910e7038a4
commit f91ced311b
3 changed files with 34 additions and 2 deletions

12
Makefile Normal file
View File

@@ -0,0 +1,12 @@
prepare-android:
rustup toolchain install stable
rustup target add x86_64-linux-android
rustup target add x86_64-unknown-linux-gnu
rustup target add aarch64-linux-android
rustup target add armv7-linux-androideabi
rustup target add i686-linux-android
make install-uniffi-bindgen
install-uniffi-bindgen:
cargo install uniffi_bindgen --version 0.19.2

View File

@@ -5,19 +5,26 @@ authors = ["Evan Feenstra <evanfeenstra@gmail.com>"]
edition = "2018"
[lib]
crate-type = ["cdylib"]
name = "crypter"
crate-type = ["staticlib", "cdylib"]
[dependencies]
sphinx-key-crypter = { path = "../crypter" }
uniffi = "0.19.2"
hex = "0.4.3"
thiserror = "1.0.31"
uniffi_macros = "0.11.0"
uniffi_macros = "0.19.2"
[build-dependencies]
uniffi_build = "0.19.2"
[profile.release]
opt-level = 'z' # Optimize for size.
lto = true # Enable Link Time Optimization
codegen-units = 1 # Reduce number of codegen units to increase optimizations.
# panic = 'abort' # Abort on panic
debug = true # Enable debug symbols. For example, we can use `dwarfdump` to check crash traces.
[patch.crates-io]
getrandom = { version = "0.2", git = "https://github.com/esp-rs-compat/getrandom.git" }
secp256k1 = { git = "https://github.com/Evanfeenstra/rust-secp256k1", branch = "v0.22.0-new-rand" }

View File

@@ -1,8 +1,21 @@
uniffi-bindgen --version
should match the uniffi version in Cargo.toml
### kotlin
rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android x86_64-unknown-linux-gnu
uniffi-bindgen generate src/crypter.udl --language kotlin
cargo build --target aarch64-linux-android --release
cargo build --target armv7-linux-androideabi --release
cargo build --target i686-linux-android --release
cross build --target aarch64-linux-android --release
### swift
uniffi-bindgen generate src/crypter.udl --language swift
### manually build the C ffi