Hello,
I have a library which has a section I do not want to build when compiling for Android, I used target_os = "android"
to detect this at compile time. However, my approach still fails. I have attached the relevant code and the list of targets below.
Conditional compilation code
#[cfg(
all(
not(feature = "pure-rust"),
any(target_arch = "x86_64", target_arch = "aarch64"),
not(any(target_os="android", target_os="androideabi",
target_os="ios"))
)
)]
For when "pure-rust" feature is not specified, and architecture is supported, and not on android or ios.
#[cfg(
not(
all(
not(feature = "pure-rust"),
any(target_arch = "x86_64", target_arch = "aarch64"),
not(any(target_os="android", target_os="androideabi",
target_os="ios"))
)
)
)]
For when "pure-rust" feature is specified, or architecture is not supported, or target_os is not supported. Just a negation of above one.
Target I have trouble with
aarch64-linux-android
My confusion
target_os
of the above target should yield android
right?
Additional questions
For armv7-linux-androideabi
, is target_os = "androideabi"
?
For i686-linux-android
, is target_os = "android"
Full context
This question originated from this issue and I'm trying to fix it in this PR.
Thanks,
Darren