Skip to content

Commit 328e723

Browse files
committed
Configure Rust build for release optimizations and update build.gradle for release variant
1 parent b9bfc60 commit 328e723

3 files changed

Lines changed: 12 additions & 0 deletions

File tree

.cargo/config.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[build]
2+
profile = "release"

wrywebview/Cargo.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ thiserror = "2.0.11"
1414
uniffi = "0.29.4"
1515
wry = "0.53.5"
1616

17+
[profile.release]
18+
opt-level = "z"
19+
lto = "fat"
20+
codegen-units = 1
21+
panic = "abort"
22+
strip = "debuginfo"
23+
incremental = false
24+
1725
[target.'cfg(target_os = "linux")'.dependencies]
1826
gtk = "0.18"
1927
glib = "0.18"

wrywebview/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import gobley.gradle.GobleyHost
2+
import gobley.gradle.Variant
23
import gobley.gradle.cargo.dsl.jvm
34
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
45

@@ -11,6 +12,7 @@ plugins {
1112
}
1213

1314
cargo {
15+
jvmVariant.set(Variant.Release)
1416
builds.jvm {
1517
embedRustLibrary = (GobleyHost.current.rustTarget == rustTarget)
1618
}

0 commit comments

Comments
 (0)