Skip to content

Try passing static link flags #638

Try passing static link flags

Try passing static link flags #638

Workflow file for this run

name: Build-Samples
on: push
jobs:
build-linux:
name: Build Samples for Linux x64
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
compiler: [ {cc: "gcc-13", cxx: "g++-13", lk: "DEFAULT"}, {cc: "clang-18", cxx: "clang++-18", lk: "LLD"} ]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
- name: Install Dependencies
run: |
sudo apt update -y
sudo apt install -y lsb-release wget software-properties-common apt-utils
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
sudo add-apt-repository -y "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main"
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update -y
sudo apt remove build-essential -y
sudo apt install gcc-13 g++-13 clang-18 llvm-18 lld-18 libfuse2 snap ninja-build libgl1-mesa-dev uuid-dev libwayland-dev libxkbcommon-dev libasound2-dev libegl-dev libvulkan-dev libx11-xcb-dev libxcb-dri2-0-dev libxcb-glx0-dev libxcb-icccm4-dev libxcb-keysyms1-dev libxcb-randr0-dev libxrandr-dev libxxf86vm-dev mesa-common-dev tree -y --no-install-recommends
sudo snap install cmake --classic
cmake --version
- name: Configure
run: |
mkdir -p build
cd build
CC=/usr/bin/${{ matrix.compiler.cc }} CXX=/usr/bin/${{ matrix.compiler.cxx }} cmake -G "Ninja" -DRAVENGINE_SERVER=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_LINKER_TYPE=${{ matrix.compiler.lk }} -DCMAKE_EXE_LINKER_FLAGS="-static -static-libcc -static-libstdc++" ..
- name: Build
run: |
cd build
cmake --build . --config release --target install
tree -L 3
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: RavEngine_Samples_linux64_${{ matrix.compiler.cc }}
path: build/Release/*.AppImage
build-linux-arm:
name: Build Samples for Linux arm64
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
- name: Setup Repositories
run: sudo mv config/crosscomp-sources.list /etc/apt/sources.list;
- name: Check apt sources
run: cat /etc/apt/sources.list
- name: Add arm64 as architecture
run: sudo dpkg --add-architecture arm64
- name: Update APT
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
- name: Install Host Dependencies
run: sudo apt install cmake:amd64 fuse:amd64 libfuse2:amd64 ninja-build:amd64 libx11-dev:amd64 libgl1-mesa-dev gcc-13:amd64 g++-13:amd64 gcc-12-aarch64-linux-gnu:amd64 g++-12-aarch64-linux-gnu:amd64 -y --no-install-recommends
- name: Install Target Dependencies
run: sudo apt install libgl1-mesa-dev:arm64 uuid-dev:arm64 libasound2-dev:arm64 libx11-dev:arm64 libxext-dev:arm64 libxrender-dev:arm64 libxrandr-dev:arm64 libxtst-dev:arm64 libxt-dev:arm64 libegl1-mesa-dev:arm64 libx11-xcb-dev:arm64 libxcb-dri2-0-dev:arm64 libxcb-glx0-dev:arm64 libxcb-icccm4-dev:arm64 libxcb-keysyms1-dev:arm64 libxcb-randr0-dev:arm64 libxrandr-dev:arm64 libxxf86vm-dev:arm64 mesa-common-dev:arm64 libwayland-dev:arm64 -y --no-install-recommends
- name: Configure
run: |
mkdir -p build
mkdir -p build/linuxarm
cd build/linuxarm
CC=/usr/bin/aarch64-linux-gnu-gcc-12 CXX=/usr/bin/aarch64-linux-gnu-g++-12 cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_SYSTEM_PROCESSOR=aarch64 -DCMAKE_SYSTEM_NAME=Linux -DRAVENGINE_BUILD_TESTS=OFF -DCMAKE_EXE_LINKER_FLAGS="-static -static-libcc -static-libstdc++" ../..
- name: Build
run: cd build/linuxarm && cmake --build . --config release --target install
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: RavEngine_Samples_linuxARM
path: build/linuxarm/Release/*.AppImage
build-emscripten:
name: Build samples for Emscripten-Linux
runs-on: ubuntu-latest
if: false
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
- name: Install Dependencies
run: sudo apt update && sudo apt install cmake clang python3 libgl1-mesa-dev libwayland-dev libxkbcommon-dev libegl-dev -y --no-install-recommends
- name: Setup Emscripten
run: git clone https://github.com/emscripten-core/emsdk.git --depth=1 && cd emsdk && ./emsdk install latest && ./emsdk activate latest && source ./emsdk_env.sh
- name: Configure
run: mkdir -p build && cd build; cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake ..
- name: Build
run: cd build; cmake --build . --config Release --target install
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: RavEngine_Samples_Web
path: |
build/Release/*.js
build/Release/*.html
build/Release/*.wasm
build/Release/*.data
build-apple:
name: Build Samples for Apple Platforms (unsigned)
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
platform: [iOS, tvOS, '']
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
- name: Configure
run: |
mkdir -p build
cd build
cmake -G "Xcode" -DCMAKE_BUILD_TYPE=Release -DCMAKE_SYSTEM_NAME=${{ matrix.platform }} -DRAVENGINE_BUILD_TESTS=OFF -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED="NO" ..
- name: Build
run: cd build; cmake --build . --config release --target install -- -quiet
- name: Free space
run: |
cd build
rm -rf build RavEngine host-tools *.build/ release/protoc release/rglc
- name: Create DMG
run: |
cd build
touch release/.Trash
hdiutil create -size 2g -srcfolder release -volname RavEngine_Samples_Apple_${{ matrix.platform }} RavEngine_Samples_Apple_${{ matrix.platform }}.dmg
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: RavEngine_Samples_Apple_${{ matrix.platform }}
path: build/RavEngine_Samples_Apple_${{ matrix.platform }}.dmg
build-windows:
name: Build samples for Windows
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
arch: [x64, ARM64]
sdk: [Windows]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Configure
run: |
mkdir build
cd build
mkdir win
cd win
cmake -A${{ matrix.arch }} -DCMAKE_SYSTEM_NAME=${{ matrix.sdk }} -DCMAKE_SYSTEM_VERSION="10.0" -DCMAKE_BUILD_TYPE=Release -DRAVENGINE_BUILD_TESTS=OFF ..\..
cmake -Wno-dev ..\..
- name: Build
run: cd build; cd win; cmake --build . --config release --target install
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: RavEngine_Samples_Win${{ matrix.arch }}
path: |
build\win\release\RavEngine*.exe
build\win\release\RavEngine*.rvedata
build\win\release\D3D12\*
build\win\release\RavEngine*Streaming\*