Added extra libraries to link for Android static build (you still need to bundle hidapi yourselves as it is build in shared mode).

This commit is contained in:
Oleg Andreev
2021-10-04 20:19:06 +03:00
parent 2f934966b6
commit c5b1b38ec0
+9 -1
View File
@@ -257,6 +257,13 @@ fn link_sdl2(target_os: &str) {
println!("cargo:rustc-link-lib=framework=AudioToolbox");
println!("cargo:rustc-link-lib=framework=Metal");
println!("cargo:rustc-link-lib=iconv");
} else if target_os == "android" {
println!("cargo:rustc-link-lib=android");
println!("cargo:rustc-link-lib=dl");
println!("cargo:rustc-link-lib=GLESv1_CM");
println!("cargo:rustc-link-lib=GLESv2");
println!("cargo:rustc-link-lib=hidapi");
println!("cargo:rustc-link-lib=log");
} else {
// TODO: Add other platform linker options here.
}
@@ -475,7 +482,8 @@ fn main() {
link_sdl2(target_os);
#[cfg(all(feature = "bundled", not(feature = "static-link")))]
// Android builds shared libhidapi.so even for static builds.
#[cfg(all(feature = "bundled", any(not(feature = "static-link"), target_os = "android")))]
{
copy_dynamic_libraries(&sdl2_compiled_path, target_os);
}