SDL: release: use NDK r21e for building Android release artifact

From 05531c5f4ba3c53c59a1bc9779868f872fc980bd Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Fri, 14 Mar 2025 01:05:49 +0100
Subject: [PATCH] release: use NDK r21e for building Android release artifact

[ci skip]
---
 .github/workflows/release.yml  | 3 +++
 build-scripts/build-release.py | 7 ++++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 4fbd583784c9e..b0215a528c6fc 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -532,6 +532,7 @@ jobs:
         with:
           sparse-checkout: 'build-scripts/build-release.py'
       - name: 'Setup Android NDK'
+        id: setup-ndk
         uses: nttld/setup-ndk@v1
         with:
           local-cache: true
@@ -561,6 +562,8 @@ jobs:
         run: |
           python build-scripts/build-release.py \
             --actions android \
+            --android-api 23 \
+            --android-ndk-home "${{ steps.setup-ndk.outputs.ndk-path }}" \
             --commit ${{ inputs.commit }} \
             --root "${{ steps.tar.outputs.path }}" \
             --github \
diff --git a/build-scripts/build-release.py b/build-scripts/build-release.py
index f3faa06c34eff..c00743e97b87a 100755
--- a/build-scripts/build-release.py
+++ b/build-scripts/build-release.py
@@ -1023,8 +1023,9 @@ def create_android_archives(self, android_api: int, android_home: Path, android_
                     "cmake",
                     "-S", str(self.root),
                     "-B", str(build_dir),
-                    f'''-DCMAKE_C_FLAGS="-ffile-prefix-map={self.root}=/src/{self.project}"''',
-                    f'''-DCMAKE_CXX_FLAGS="-ffile-prefix-map={self.root}=/src/{self.project}"''',
+                    # NDK 21e does not support -ffile-prefix-map
+                    # f'''-DCMAKE_C_FLAGS="-ffile-prefix-map={self.root}=/src/{self.project}"''',
+                    # f'''-DCMAKE_CXX_FLAGS="-ffile-prefix-map={self.root}=/src/{self.project}"''',
                     f"-DCMAKE_TOOLCHAIN_FILE={cmake_toolchain_file}",
                     f"-DCMAKE_PREFIX_PATH={str(android_deps_path)}",
                     f"-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=BOTH",
@@ -1530,7 +1531,7 @@ def main(argv=None) -> int:
             parser.error("Invalid --android-api, and/or could not be detected")
         android_api_path = Path(args.android_home) / f"platforms/{args.android_api.name}"
         if not android_api_path.is_dir():
-            parser.error(f"Android API directory does not exist ({android_api_path})")
+            logger.warning(f"Android API directory does not exist ({android_api_path})")
         with section_printer.group("Android arguments"):
             print(f"android_home     = {args.android_home}")
             print(f"android_ndk_home = {args.android_ndk_home}")