Skip to content

Commit 8f0678f

Browse files
committed
Add UE 5.3 Linux build.
1 parent cebc33d commit 8f0678f

File tree

3 files changed

+124
-0
lines changed

3 files changed

+124
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Install Unreal Engine
2+
inputs:
3+
unreal-engine-zip:
4+
required: true
5+
type: string
6+
aws-access-key-id:
7+
required: true
8+
type: string
9+
aws-secret-access-key:
10+
required: true
11+
type: string
12+
runs:
13+
using: composite
14+
steps:
15+
- name: Download Unreal Engine
16+
env:
17+
AWS_REGION: us-east-1
18+
AWS_ACCESS_KEY_ID: ${{ inputs.aws-access-key-id }}
19+
AWS_SECRET_ACCESS_KEY: ${{ inputs.aws-secret-access-key }}
20+
shell: bash
21+
run: |
22+
aws s3 cp ${{ inputs.unreal-engine-zip }} ./ue.zip --no-progress
23+
- name: Unzip Unreal Engine
24+
shell: bash
25+
run: |
26+
unzip -q ue.zip -d $HOME
27+
rm ue.zip

.github/workflows/build.yml

+10
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,16 @@ jobs:
476476
unreal-program-name: "UE_5.3"
477477
upload-package-base-name: "CesiumForUnreal-53-android"
478478
android-ndk-version: "r25b"
479+
Linux53:
480+
uses: ./.github/workflows/buildLinux.yml
481+
secrets: inherit
482+
with:
483+
runner-label: ubuntu-latest
484+
unreal-engine-version: "5.3.0"
485+
unreal-engine-zip: "s3://cesium-unreal-engine/5.3.0/Linux_Unreal_Engine_5.3.0.zip"
486+
unreal-program-name: "UE_5.3"
487+
upload-package-base-name: "CesiumForUnreal-53-linux"
488+
clang-version: "v22_clang-16.0.6-centos7"
479489
# Linux53:
480490
# runs-on: ["self-hosted","linux","x64","unreal-53"]
481491
# steps:

.github/workflows/buildLinux.yml

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Build Linux
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
runner-label:
7+
required: true
8+
type: string
9+
unreal-engine-version:
10+
required: true
11+
type: string
12+
unreal-engine-zip:
13+
required: true
14+
type: string
15+
unreal-program-name:
16+
required: true
17+
type: string
18+
upload-package-base-name:
19+
required: true
20+
type: string
21+
extra-choco-packages:
22+
required: false
23+
type: string
24+
default: ''
25+
clang-version:
26+
required: true
27+
type: string
28+
jobs:
29+
build:
30+
runs-on: ${{ inputs.runner-label }}
31+
- name: Check out repository code
32+
uses: actions/checkout@v4
33+
with:
34+
submodules: recursive
35+
- name: Install nasm
36+
uses: ilammy/[email protected]
37+
- name: Install Ninja
38+
run: |
39+
sudo apt install ninja
40+
- name: Install Unreal Engine
41+
uses: ./.github/actions/install-unreal-linux
42+
with:
43+
unreal-engine-zip: ${{ inputs.unreal-engine-zip }}
44+
unreal-program-name: ${{ inputs.unreal-program-name }}
45+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
46+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
47+
- name: Set environment variables
48+
run: |
49+
echo "CESIUM_UNREAL_VERSION=$GITHUB_REF_NAME" >> "$GITHUB_ENV"
50+
echo "BUILD_CESIUM_UNREAL_PACKAGE_NAME=${{ inputs.upload-package-base-name }}-${CESIUM_UNREAL_VERSION}" >> "$GITHUB_ENV"
51+
echo "UNREAL_ENGINE_DIR=$HOME/${{ inputs.unreal-program-name }}" >> "$GITHUB_ENV"
52+
echo "LINUX_MULTIARCH_ROOT=$UNREAL_ENGINE_DIR/Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/${{ inputs.clang-version }}/" >> "$GITHUB_ENV"
53+
- name: Build cesium-native
54+
run: |
55+
export UNREAL_ENGINE_COMPILER_DIR="${LINUX_MULTIARCH_ROOT}x86_64-unknown-linux-gnu"
56+
export UNREAL_ENGINE_LIBCXX_DIR="${UNREAL_ENGINE_DIR}/Engine/Source/ThirdParty/Unix/LibCxx"
57+
cd extern
58+
cmake -B build -S . -G Ninja -DCMAKE_TOOLCHAIN_FILE="unreal-linux-toolchain.cmake" -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release
59+
cmake --build build --config Release --target install -j8
60+
cd ..
61+
rm -rf extern
62+
- name: Build plugin
63+
run: |
64+
mkdir -p ~/.config/Unreal\ Engine/UnrealBuildTool
65+
printf '<?xml version="1.0" encoding="utf-8" ?>\n<Configuration xmlns="https://www.unrealengine.com/BuildConfiguration">\n <BuildConfiguration>\n <MaxParallelActions>2</MaxParallelActions>\n </BuildConfiguration>\n</Configuration>\n' > ~/.config/Unreal\ Engine/UnrealBuildTool/BuildConfiguration.xml
66+
sed -i 's/\"EngineVersion\": \"5.1.0\"/\"EngineVersion\": \"${{ inputs.unreal-engine-version }}\"/g' CesiumForUnreal.uplugin
67+
cd $UNREAL_ENGINE_DIR/Engine/Build/BatchFiles
68+
./RunUAT.sh BuildPlugin -Plugin="$GITHUB_WORKSPACE/CesiumForUnreal.uplugin" -Package="$GITHUB_WORKSPACE/packages/CesiumForUnreal" -CreateSubFolder -TargetPlatforms=Linux
69+
- name: Fix RPATH
70+
run: |
71+
sudo yum install -y patchelf
72+
cd $GITHUB_WORKSPACE/packages/CesiumForUnreal/Binaries/Linux
73+
patchelf --print-rpath libUnrealEditor-CesiumRuntime.so
74+
export UPDATED_RPATH=`patchelf --print-rpath libUnrealEditor-CesiumRuntime.so | sed 's/${ORIGIN}[^:]*\/SunPosition\/Binaries\/Linux/${ORIGIN}\/..\/..\/..\/..\/Runtime\/SunPosition\/Binaries\/Linux/'`
75+
patchelf --force-rpath --set-rpath "$UPDATED_RPATH" libUnrealEditor-CesiumRuntime.so
76+
- name: Compress debug sections
77+
run: |
78+
for f in packages/CesiumForUnreal/Binaries/Linux/*.so; do objcopy --compress-debug-sections $f; done
79+
for f in packages/CesiumForUnreal/Binaries/Linux/*.debug; do objcopy --compress-debug-sections $f; done
80+
for f in packages/CesiumForUnreal/Intermediate/Build/Linux/x64/UnrealGame/Development/CesiumRuntime/*.o; do objcopy --compress-debug-sections $f; done
81+
for f in packages/CesiumForUnreal/Intermediate/Build/Linux/x64/UnrealGame/Shipping/CesiumRuntime/*.o; do objcopy --compress-debug-sections $f; done
82+
- name: Publish plugin package artifact
83+
if: ${{ success() }}
84+
uses: actions/upload-artifact@v4
85+
with:
86+
name: ${{ env.BUILD_CESIUM_UNREAL_PACKAGE_NAME}}
87+
path: packages

0 commit comments

Comments
 (0)