Skip to content

Conversation

xia0pin9
Copy link

@xia0pin9 xia0pin9 commented Sep 2, 2025

Extends existing iOS platform support to include Android-specific CMake fixes:

Platform crypto configuration:

  • Rename configure_openssl() to configure_platform_crypto() for clarity
  • Add Android platform detection alongside iOS
  • Disable OpenSSL for Android (uses native crypto instead)

Android CMake fixes:

  • Add configure_android_cmake() function to override NDK defaults
  • Force correct ANDROID_ABI settings before project() call
  • Support all Android architectures: arm64-v8a, armeabi-v7a, x86_64, x86
  • Override NDK toolchain's problematic ARMv7 defaults for ARM64 builds

This resolves the CMake architecture mixing issue where Android NDK defaults to ARMv7 settings even when building for ARM64 targets.

The patch maintains full backward compatibility and extends the existing mobile platform support pattern established for iOS builds.

Ryan and others added 9 commits August 31, 2025 19:55
…d platforms

This commit introduces platform-aware OpenSSL configuration to resolve iOS build
issues while maintaining backward compatibility for all platforms.

Key changes:
- Add configure_openssl() function for intelligent platform detection
- Support OQS_USE_OPENSSL environment variable (OFF/ON) for explicit control
- Add no_openssl feature flag to force disable OpenSSL on any platform
- Auto-disable OpenSSL for iOS targets with Security.framework linking
- Enhance CI/CD with iOS cross-compilation testing (x86_64, aarch64)
- Add comprehensive unit and integration tests
- Update documentation with platform-specific guidance

Platform behavior:
- iOS: OpenSSL automatically disabled, uses Security.framework
- Other platforms: OpenSSL enabled by default (overridable)
- Environment variable takes precedence over feature flags

This addresses the critical iOS build failures caused by unconditional
OpenSSL requirements while enabling embedded systems and compliance use cases
that require OpenSSL-free builds.

🤖 Generated with Claude Code

Co-Authored-By: Claude <[email protected]>
Extends existing iOS platform support to include Android-specific CMake fixes:

Platform crypto configuration:
- Rename configure_openssl() to configure_platform_crypto() for clarity
- Add Android platform detection alongside iOS
- Disable OpenSSL for Android (uses native crypto instead)

Android CMake fixes:
- Add configure_android_cmake() function to override NDK defaults
- Force correct ANDROID_ABI settings before project() call
- Support all Android architectures: arm64-v8a, armeabi-v7a, x86_64, x86
- Override NDK toolchain's problematic ARMv7 defaults for ARM64 builds

This resolves the CMake architecture mixing issue where Android NDK
defaults to ARMv7 settings even when building for ARM64 targets.

The patch maintains full backward compatibility and extends the existing
mobile platform support pattern established for iOS builds.

🤖 Generated with Claude Code

Co-Authored-By: Claude <[email protected]>
- Try multiple NDK environment variables (ANDROID_NDK_HOME, ANDROID_NDK_ROOT, etc.)
- Auto-detect NDK from ANDROID_HOME/ndk if env vars not set
- Set CMAKE_TOOLCHAIN_FILE automatically based on detected NDK
- Add CMAKE_MAKE_PROGRAM to avoid CMake build tool errors

Fixes CMake 'NDK not found' error when cargo-ndk doesn't propagate environment.
Pass reference to toolchain_file instead of moving ownership
Fix CI formatting issues in configure_android_cmake function
@dstebila
Copy link
Member

Thanks very much for the contribution!

Looks good to me. The one thing left blocking the commit is the Developer Certificate of Origin (DCO) sign-off. Would you be able to follow the instructions in https://github.com/open-quantum-safe/liboqs-rust/pull/299/checks?check_run_id=49462652917 to add the DCO sign-off to your commits?

@dstebila
Copy link
Member

What's the relationship between #297 and #299? Does #299 include the commits from #297?

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.

2 participants