release: use NDK r21e for building Android release artifact

[ci skip]
This commit is contained in:
Anonymous Maarten
2025-03-14 01:05:49 +01:00
parent 18185e30e9
commit 05531c5f4b
2 changed files with 7 additions and 3 deletions

View File

@@ -532,6 +532,7 @@ jobs:
with: with:
sparse-checkout: 'build-scripts/build-release.py' sparse-checkout: 'build-scripts/build-release.py'
- name: 'Setup Android NDK' - name: 'Setup Android NDK'
id: setup-ndk
uses: nttld/setup-ndk@v1 uses: nttld/setup-ndk@v1
with: with:
local-cache: true local-cache: true
@@ -561,6 +562,8 @@ jobs:
run: | run: |
python build-scripts/build-release.py \ python build-scripts/build-release.py \
--actions android \ --actions android \
--android-api 23 \
--android-ndk-home "${{ steps.setup-ndk.outputs.ndk-path }}" \
--commit ${{ inputs.commit }} \ --commit ${{ inputs.commit }} \
--root "${{ steps.tar.outputs.path }}" \ --root "${{ steps.tar.outputs.path }}" \
--github \ --github \

View File

@@ -1023,8 +1023,9 @@ class Releaser:
"cmake", "cmake",
"-S", str(self.root), "-S", str(self.root),
"-B", str(build_dir), "-B", str(build_dir),
f'''-DCMAKE_C_FLAGS="-ffile-prefix-map={self.root}=/src/{self.project}"''', # NDK 21e does not support -ffile-prefix-map
f'''-DCMAKE_CXX_FLAGS="-ffile-prefix-map={self.root}=/src/{self.project}"''', # 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_TOOLCHAIN_FILE={cmake_toolchain_file}",
f"-DCMAKE_PREFIX_PATH={str(android_deps_path)}", f"-DCMAKE_PREFIX_PATH={str(android_deps_path)}",
f"-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=BOTH", 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") parser.error("Invalid --android-api, and/or could not be detected")
android_api_path = Path(args.android_home) / f"platforms/{args.android_api.name}" android_api_path = Path(args.android_home) / f"platforms/{args.android_api.name}"
if not android_api_path.is_dir(): 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"): with section_printer.group("Android arguments"):
print(f"android_home = {args.android_home}") print(f"android_home = {args.android_home}")
print(f"android_ndk_home = {args.android_ndk_home}") print(f"android_ndk_home = {args.android_ndk_home}")