Skip to content

Android Build - #6992

Open
Shivansps wants to merge 37 commits into
scp-fs2open:masterfrom
Shivansps:android-build
Open

Shivansps wants to merge 37 commits into
scp-fs2open:masterfrom
Shivansps:android-build

Conversation

@Shivansps

@Shivansps Shivansps commented Aug 23, 2025

Copy link
Copy Markdown
Contributor

Android OS:

  • Currently working on all archs with 16KB alignment too
  • Running on GLES 3.2 (minimum req, uses functions from it).
  • Running on Vulkan as well.
  • Limited FFmpeg lib to 6.1 as current master does not work for playing sound on cutscenes. Yet this version seems to work OK.

-Added "-get_flags json_v2": It is a minimal version of the v1 removing all info related to configuration. To avoid doing sdl inits while getting flags. This is mostly intended to list cmdline flag data for the "configure" option in knossos mods.

Note: It is now possible to compile both fso and the prebuilt libs with just an script on a linux x64 system with only having the same dependencies needed to compile normally.
https://github.com/Shivansps/Fso-Android-Prebuilts

A docker file was also added.

Note2: without #7489 android builds can only be compiled for Vulkan and will work if the device supports hardware clipping. 7489 fixes GLES compile, adds support in internal shaders and adds SW fallback for clip in vulkan.

For compiling, as it is in the script, its petty much two operations, first compile the embedded file, then the normal builds by turning off QTFRED and OPENXR. Android NDK is needed, R29 is recommended as it enables 16KB alignment.

# Make embedfile
mkdir tool && cd tool
cmake .. -DFSO_BUILD_WITH_OPENXR=OFF -DFSO_BUILD_QTFRED=OFF -DFSO_BUILD_TOOLS=ON -G Ninja
ninja embedfile

#Compile arm64-v8a debug and release builds
export ANDROID_NDK_HOME=../../android_ndk_r29 #path to the root of extracted folder of the NDK
export ANDROID_PLATFORM=android-28
export TARGET_ABI=arm64-v8a
mkdir "$TARGET_ABI"_debug && cd "$TARGET_ABI"_debug
cmake .. -DFSO_BUILD_WITH_OPENGL_DEBUG=ON -DFSO_BUILD_WITH_OPENXR=OFF -DFSO_BUILD_QTFRED=OFF -DFSO_BUILD_WITH_OPENGL_ES=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI=$TARGET_ABI -DANDROID_PLATFORM=$ANDROID_PLATFORM -DEMBEDFILE_PATH=../tool/bin/embedfile -G Ninja && sed -i 's/-lusb-1.0//' build.ninja
ninja
cd ..

mkdir "$TARGET_ABI"_release && cd "$TARGET_ABI"_release
cmake .. -DFSO_BUILD_WITH_OPENGL_ES=ON -DFSO_BUILD_WITH_OPENXR=OFF -DFSO_BUILD_QTFRED=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI=$TARGET_ABI -DANDROID_PLATFORM=$ANDROID_PLATFORM -DEMBEDFILE_PATH=../tool/bin/embedfile -G Ninja && sed -i 's/-lusb-1.0//' build.ninja
ninja
cd ..

While testing FSO and Knossos i did build x86 and arm32 bit builds, but in the end this is not worth it and i dont even think im going to ship Knossos with 32bits support either, so it is recommended not to waster time and space in 32bit builds.

@notimaginative

Copy link
Copy Markdown
Contributor

Regarding point 1, the prebuilt override bug, that's fixed in the SDL3 branch. I keep forgetting to split that off into it's own thing and PR it.

Another thing is that since we've moved to a newer cmake version we can technically replicate embedfile with a platform agnostic cmake script. That's been on my todo list for a while since it's the only thing holding up Windows arm64 builds.

@wookieejedi wookieejedi added the build An issue related to the build systems label Aug 24, 2025
@Shivansps
Shivansps force-pushed the android-build branch 2 times, most recently from 2b6fca8 to ca6b8a7 Compare September 23, 2025 22:55
@BMagnu BMagnu added the Waiting for Stable Marks a pull request that is to be merged after the next stable release, due to a release cycle label May 31, 2026
@BMagnu BMagnu removed the Waiting for Stable Marks a pull request that is to be merged after the next stable release, due to a release cycle label Jul 5, 2026
@Shivansps
Shivansps marked this pull request as ready for review July 26, 2026 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build An issue related to the build systems

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants