ML Branch UE 5.4.3
Hello! I am wondering if there is a way to compile for Android x86_64 with Unreal Engine?
My goal is to get Cesium to work on Magic Leap 2.
I saw a solution for Unity posted here, but I am unsure how to replicate it for Unreal.
These are the existing errors:
Thank you!
It’s probably possible, but we haven’t tried.
First, you’ll need to compile cesium-native from the extern
directory for Android / x64. The part of the CI script that builds it for ARM64 is here:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Build cesium-native
run: |
# CMake gets confused by the Windows backslashes
$env:ANDROID_NDK_ROOT=$env:ANDROID_NDK_ROOT.replace('\', '/')
$env:ANDROID_NDK_HOME=$env:ANDROID_NDK_ROOT
$env:UNREAL_ENGINE_ROOT="D:/Program Files/Epic Games/${{ inputs.unreal-program-name }}"
$env:CESIUM_VCPKG_RELEASE_ONLY="TRUE"
cd extern
cmake -B build-android -S . -G Ninja -DCMAKE_TOOLCHAIN_FILE="unreal-android-toolchain.cmake" -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release
cmake --build build-android --config Release --target install -j8
cd ..
rm -r -fo extern
- name: Overwrite plugin engine version
run: |
((Get-Content -path CesiumForUnreal.uplugin -Raw) -replace '"EngineVersion": "5.2.0"','"EngineVersion": "${{ inputs.unreal-engine-version }}"') | Set-Content -Path CesiumForUnreal.uplugin
- name: Customize BuildConfiguration.xml
run: |
mkdir -p "$env:USERPROFILE\AppData\Roaming\Unreal Engine\UnrealBuildTool"
# - We limit parallel actions because our builds use a lot more memory than UBT thinks they will.
So you’ll need an alternate version of unreal-android-toolchain.cmake
that targets the other processor architecture. You’ll also need a vcpkg triplet for it:
Finally, you’ll need to update CesiumRuntime.build.cs and CesiumEditor.build.cs to look for the built libraries in the correct location: