Skip to content
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: Update build script to enable cross compiling for Android #264

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

nappairam
Copy link

@nappairam nappairam commented Aug 6, 2024

Enable building liboqs-rust for Android target.

Based on the cmake manual, cross compiling for Android,
https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling-for-android-with-the-ndk

CMAKE_SYSTEM_NAME must be set to Android.

Additionally, set CMAKE_ANDROID_NDK if corresponding env var is available.
Android ecosystem uses both ANDROID_NDK_ROOT and ANDROID_NDK_HOME to refer to NDK's path.

For example, github runners has both variables set:
actions/runner-images#2426

These two cmake variables are sufficient to build for Android with cargo-ndk tool.

I have also fixed the mac-os CI issue and added a step to verify android builds for unix variants.

@nappairam nappairam force-pushed the android-build branch 2 times, most recently from 09e9506 to 1e2c000 Compare August 6, 2024 16:13
@nappairam nappairam changed the title Update build script to enable cross compiling for Android (feat) Update build script to enable cross compiling for Android Aug 6, 2024
@nappairam nappairam changed the title (feat) Update build script to enable cross compiling for Android (build) Update build script to enable cross compiling for Android Aug 6, 2024
Use updated Brew path after M1 mac (current macos-latest)
https://github.com/actions/runner-images/blob/main/images/macos/macos-14-Readme.md#utilities

Signed-off-by: Mariappan Ramasamy <1221719+nappairam@users.noreply.github.com>
Based on the cmake manual, cross compiling for Android,
https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling-for-android-with-the-ndk

CMAKE_SYSTEM_NAME **must** be set to Android.

Additionally, set CMAKE_ANDROID_NDK if corresponding env var is available.
Android ecosystem uses both ANDROID_NDK_ROOT and ANDROID_NDK_HOME to refer to
NDK's path. For example, github runners has both variables set:
actions/runner-images#2426

These two cmake variables are sufficient to build for Android with cargo-ndk tool.

Signed-off-by: Mariappan Ramasamy <1221719+nappairam@users.noreply.github.com>
@nappairam nappairam changed the title (build) Update build script to enable cross compiling for Android build: Update build script to enable cross compiling for Android Aug 6, 2024
Also update CI strategy to fail-fast to allow running other jobs in matrix.

Signed-off-by: Mariappan Ramasamy <1221719+nappairam@users.noreply.github.com>
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.

1 participant