Allow specifying min_sdk_version in dioxus config for Android. (#4549)

* allow specifying min_sdk_version inside dioxus config

* rustfmt
This commit is contained in:
Rhaskia authored and GitHub committed 2025-08-14 20:05:26 -07:00
1 parent 593945ecce
commit 2a0f328c42
4 files changed
+29 -16

No files matched your search

+3 -12
View File
@@ -157,19 +157,15 @@ impl AndroidTools {
/// "~/Library/Android/sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/darwin-x86_64/bin/ld"
///
/// However, for our purposes, we only go through the cc driver and not the linker directly.
pub(crate) fn android_cc(&self, triple: &Triple) -> PathBuf {
pub(crate) fn android_cc(&self, triple: &Triple, sdk_version: u32) -> PathBuf {
let suffix = if cfg!(target_os = "windows") {
".cmd"
} else {
""
};
self.android_tools_dir().join(format!(
"{}{}-clang{}",
triple,
self.min_sdk_version(),
suffix
))
self.android_tools_dir()
.join(format!("{}{}-clang{}", triple, sdk_version, suffix))
}
pub(crate) fn sysroot(&self) -> PathBuf {
@@ -191,11 +187,6 @@ impl AndroidTools {
self.sdk().join("emulator").join("emulator")
}
// todo(jon): this should be configurable
pub(crate) fn min_sdk_version(&self) -> u32 {
24
}
pub(crate) fn clang_folder(&self) -> PathBuf {
// The clang folder is usually located in the NDK under:
// "~/Library/Android/sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/darwin-x86_64/lib/clang/<version>"