Skip to content

Conversation

@svpolonsky
Copy link
Contributor

Describe the changes

Modified build.rs scripts to pass ANDROID flags to cmake.

Reviewer, please voice your opinion if the following approach is OK:

// check if cross-compilation is required
let target = std::env::var("TARGET").unwrap();
if target.contains("android") {
    config.define("BUILD_FOR_ANDROID", "ON");
}

added ./scripts/cross-compilation/android directory

The directory has a README.md and a Dockerfile to build the required toolchain

@svpolonsky svpolonsky requested a review from yshekel April 10, 2025 09:27
Comment on lines +57 to +69
COPY <<EOF /root/.cargo/config.toml
[target.aarch64-linux-android]
linker = "${ANDROID_NDK_HOME}toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang"
ar = "${ANDROID_NDK_HOME}toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-ar"

[target.armv7-linux-androideabi]
linker = "${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi21-clang"
ar = "${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar"

[target.x86_64-linux-android]
linker = "${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android21-clang"
ar = "${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar"
EOF
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why isn't this in the ICICLE Cargo.toml? This seems like it will affect the users entire cargo setup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants