-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build for aarch64-linux-android #605
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the PR. LGTM.
@@ -254,7 +263,7 @@ impl LlamaSampler { | |||
.into_iter() | |||
.map(|s| CString::new(s.as_ref()).unwrap()) | |||
.collect(); | |||
let mut seq_breaker_pointers: Vec<*const i8> = | |||
let mut seq_breaker_pointers: Vec<*const CChar> = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let mut seq_breaker_pointers: Vec<*const CChar> = | |
let mut seq_breaker_pointers = |
// this is needed for the dry sampler to typecheck on android | ||
// ...because what is normally an i8, is an u8 | ||
#[cfg(target_os = "android")] | ||
type CChar = u8; | ||
|
||
#[cfg(not(target_os = "android"))] | ||
type CChar = i8; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// this is needed for the dry sampler to typecheck on android | |
// ...because what is normally an i8, is an u8 | |
#[cfg(target_os = "android")] | |
type CChar = u8; | |
#[cfg(not(target_os = "android"))] | |
type CChar = i8; |
If the compiler can infer the type (and we avoid the platform-specific-types) that would be best. bindgen often also generates types that work accross platforms, unsure what it should be in this case. |
...does what it says on the tin.
We're building a Godot plugin, and people are requesting android support.
It seems to work for us:
nobodywho-ooo/nobodywho#67
There are two changes:
i8
type that is anu8
in the android NDK. I just set this type to be au8
whe compiling for android.I'm not really an android dev, so not an expert on any of this. But it seems to work.