Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions super_native_extensions/rust/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,19 @@ mod gen_keyboard_map;

fn main() {
let target_system = std::env::var("CARGO_CFG_TARGET_OS").unwrap();
let target_arch = std::env::var("CARGO_CFG_TARGET_ARCH").unwrap();

// keyboard map is currently only supported on desktop.
match target_system.as_str() {
"macos" | "linux" | "windows" => {
gen_keyboard_map::generate_keyboard_map(&target_system).unwrap();
}
_ => {}
}

// Add support for the maximum page size of 16 KB for Android (only on the arm64 and x86_64 platforms).
// see: https://developer.android.com/guide/practices/page-sizes#other-build-systems
if target_system == "android" && (target_arch == "aarch64" || target_arch == "x86_64") {
println!("cargo:rustc-link-arg=-Wl,-z,max-page-size=16384");
}
}