Skip to content

Commit aed55b4

Browse files
authored
Merge pull request #7 from isblu/feat/android-16kb-page-size
16KB page sizes support
2 parents 8281e62 + 2b03858 commit aed55b4

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

android/convexmobile/build.gradle

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ cargo {
5454
libname = "convexmobile"
5555
targets = ["arm64", "arm"]
5656
profile = "release"
57+
58+
exec { spec, toolchain ->
59+
// Support 16KB page sizes
60+
// https://developer.android.com/guide/practices/page-sizes#other-build-systems
61+
spec.environment("RUST_ANDROID_GRADLE_CC_LINK_ARG", "-Wl,-z,max-page-size=16384,-soname,lib${libname}.so")
62+
}
5763
}
5864

5965
tasks.whenTaskAdded { task ->
@@ -75,7 +81,7 @@ tasks.register("generateUniFFIBinary", Exec) {
7581
android.libraryVariants.all { variant ->
7682
def t = tasks.register("generate${variant.name.capitalize()}UniFFIBindings", Exec) {
7783
workingDir "${project.projectDir}/../../rust"
78-
commandLine './target/debug/uniffi-bindgen', 'generate', '--library', "${project.layout.buildDirectory.asFile.get().path}/rustJniLibs/android/arm64-v8a/libconvexmobile.so", '--language', 'kotlin', '--out-dir', "${project.layout.buildDirectory.asFile.get().path}/generated/source/uniffi/${variant.name}/java"
84+
commandLine 'cargo', 'run', '--bin', 'uniffi-bindgen', '--', 'generate', '--library', "${project.layout.buildDirectory.asFile.get().path}/rustJniLibs/android/arm64-v8a/libconvexmobile.so", '--language', 'kotlin', '--out-dir', "${project.layout.buildDirectory.asFile.get().path}/generated/source/uniffi/${variant.name}/java"
7985
dependsOn 'generateUniFFIBinary'
8086
}
8187
def sourceSet = variant.sourceSets.find { it.name == variant.name }
@@ -174,4 +180,4 @@ task stopConvexLocalBackend {
174180
tasks.convexLocalBackend.process.destroy()
175181
}
176182
}
177-
}
183+
}

0 commit comments

Comments
 (0)