Skip to content

Modernize Android 3p build scripts for current NDK/CMake - #388

Open
byrcolin wants to merge 1 commit into
o3de:mainfrom
byrcolin:android-build-modernization
Open

Modernize Android 3p build scripts for current NDK/CMake#388
byrcolin wants to merge 1 commit into
o3de:mainfrom
byrcolin:android-build-modernization

Conversation

@byrcolin

@byrcolin byrcolin commented Jul 21, 2026

Copy link
Copy Markdown

What does this PR do?

Fixes the Android 3p package build scripts so they work with current NDK and CMake versions. No functional change to package outputs.

  • Toolchain: opt out of the NDK's legacy toolchain wrapper (ANDROID_USE_LEGACY_TOOLCHAIN_FILE OFF), which is broken with CMake 4.x
  • mikkelsen: remove hardcoded NDK r21d path (uses the LY_NDK_DIR env var, which the toolchain already supports), drop the API level pin (toolchain enforces and defaults to 24), remove obsolete arm32 flags (ANDROID_ARM_MODE/ANDROID_ARM_NEON modern NDKs hard-error on disabling NEON, and both are meaningless for arm64-v8a)
  • zlib: pass CMAKE_POLICY_VERSION_MINIMUM=3.5 so zlib's ancient cmake_minimum_required(VERSION 2.4.4) configures under CMake 4.x (must be on the command line the top-level version check runs before the toolchain file is read)
  • .gitignore: exclude build/ folders

How was this tested?

Built with NDK r27.3.13750724 / CMake 4.1 on Windows:

  • mikkelsen: debug + release via Ninja Multi-Config, both installed correctly
  • zlib: build_zlib_android.cmd links libz.a cleanly

Related

Prerequisite for the Android 16KB page alignment work: RFC o3de/o3de#19936

- Toolchain: opt out of the legacy NDK toolchain wrapper, which is broken with CMake 4.x
- mikkelsen: remove hardcoded NDK r21d path (use LY_NDK_DIR env var), drop API level pin (toolchain enforces/defaults to 24), remove obsolete arm32 flags (ANDROID_ARM_MODE/ANDROID_ARM_NEON) that modern NDKs reject
- zlib: pass CMAKE_POLICY_VERSION_MINIMUM=3.5 so zlib's ancient cmake_minimum_required configures under CMake 4.x
- gitignore: exclude build/ folders

Verified: mikkelsen (debug+release via Ninja Multi-Config) and zlib build with NDK r27.3 / CMake 4.1
Signed-off-by: colinb <colinb@accesspointmg.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