Skip to content

Commit 690209b

Browse files
committed
feat: Add support for the maximum page size of 16 KB for Android (only on the arm64 and x86_64 platforms).
1 parent 6413620 commit 690209b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

super_native_extensions/rust/build.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,19 @@ mod gen_keyboard_map;
33

44
fn main() {
55
let target_system = std::env::var("CARGO_CFG_TARGET_OS").unwrap();
6+
let target_arch = std::env::var("CARGO_CFG_TARGET_ARCH").unwrap();
7+
68
// keyboard map is currently only supported on desktop.
79
match target_system.as_str() {
810
"macos" | "linux" | "windows" => {
911
gen_keyboard_map::generate_keyboard_map(&target_system).unwrap();
1012
}
1113
_ => {}
1214
}
15+
16+
// Add support for the maximum page size of 16 KB for Android (only on the arm64 and x86_64 platforms).
17+
// see: https://developer.android.com/guide/practices/page-sizes#other-build-systems
18+
if target_system == "android" && (target_arch == "aarch64" || target_arch == "x86_64") {
19+
println!("cargo:rustc-link-arg=-Wl,-z,max-page-size=16384");
20+
}
1321
}

0 commit comments

Comments
 (0)