Android cpu-features and add Android CI - #29
Merged
Conversation
src/core/cpu.cpp includes "cpu-features.h" on Android, but the NDK keeps the header and cpu-features.c under sources/android/cpufeatures/, outside the sysroot. CMake builds fail unless that directory is staged explicitly. Port the CMake-side staging used by cryptopp-cmake: add the NDK cpufeatures directory to the include path and append cpu-features.c to cryptopp_SOURCES when ANDROID is set. Warn if the expected files are not present. Refs: #27
ubuntu-24.04 runners currently expose the Android NDK via $ANDROID_NDK_LATEST_HOME. Add two CI jobs that cross-compile the cryptopp library for arm64-v8a and armeabi-v7a using the NDK toolchain. These jobs are build-only, with no emulator step. That is enough to catch regressions in the Android NEON path and in CMake Android cpu-features staging. Add corresponding presets to CMakePresets.json. CRYPTOPP_BUILD_TESTING is OFF because the cross-compiled cryptest binary cannot run on the runner. Refs: #27
Coralesoft
force-pushed
the
fix/issue-27-android-cmake-cpufeatures
branch
from
May 14, 2026 23:06
bab42fb to
5f55a14
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes the remaining work from #27. PR #28 fixed the BLAKE3 armv7 NEON issue, this one covers the follow-up CMake and CI work.
Stages Android NDK
cpu-featuresfor CMake builds by adding the NDKcpufeaturesdirectory andcpu-features.cwhenANDROIDis set.Adds build-only Android CI jobs for
arm64-v8aandarmeabi-v7a. No emulator step; this is just to catch Android build-path regressions.Verification
Host build passes cleanly.
Android cross-compile is covered by the new CI jobs.
Refs: #27