Browse Source
Adds support for just enough SDL3 to make `text_render_integration_test` work.pull/8212/head
43 changed files with 766 additions and 166 deletions
@ -0,0 +1,51 @@
|
||||
name: Linux x64 SDL3 Tests |
||||
|
||||
on: |
||||
push: |
||||
branches: |
||||
- master |
||||
paths-ignore: |
||||
- '*.md' |
||||
- 'docs/**' |
||||
pull_request: |
||||
types: [ opened, synchronize ] |
||||
paths-ignore: |
||||
- '*.md' |
||||
- 'docs/**' |
||||
workflow_dispatch: |
||||
|
||||
concurrency: |
||||
group: ${{ github.workflow }}-${{ github.ref }} |
||||
cancel-in-progress: true |
||||
|
||||
jobs: |
||||
build: |
||||
runs-on: ubuntu-22.04 |
||||
|
||||
steps: |
||||
- uses: actions/checkout@v5 |
||||
with: |
||||
fetch-depth: 0 |
||||
|
||||
- name: Install dependencies |
||||
run: | |
||||
sudo apt-get update -y |
||||
sudo apt-get install -y cmake curl g++ git libgtest-dev libgmock-dev libbenchmark-dev libfmt-dev libsodium-dev libpng-dev libbz2-dev wget |
||||
|
||||
- name: Cache CMake build folder |
||||
uses: actions/cache@v4 |
||||
with: |
||||
path: build |
||||
key: ${{ github.workflow }}-v2-${{ github.sha }} |
||||
restore-keys: ${{ github.workflow }}-v2- |
||||
|
||||
# We specify `-DDEVILUTIONX_SYSTEM_BENCHMARK=OFF` to work around the following error: |
||||
# lto1: fatal error: bytecode stream in file ‘/usr/lib/x86_64-linux-gnu/libbenchmark_main.a’ generated with LTO version 11.2 instead of the expected 11.3 |
||||
- name: Build tests |
||||
run: | |
||||
cmake -S. -Bbuild -G Ninja -DUSE_SDL3=ON -DDEVILUTIONX_SYSTEM_SDL3=OFF -DDEVILUTIONX_STATIC_SDL3=ON -DDEVILUTIONX_SYSTEM_SDL_IMAGE=OFF -DNOSOUND=ON -DDEVILUTIONX_SYSTEM_BENCHMARK=OFF |
||||
wget -qnc https://github.com/diasurgical/devilutionx-assets/releases/download/v2/spawn.mpq -P build |
||||
cmake --build build -j $(nproc) --target text_render_integration_test |
||||
|
||||
- name: Run tests |
||||
run: cd build && ctest -R 'TextRenderIntegrationTest' --output-on-failure |
||||
@ -0,0 +1,31 @@
|
||||
#pragma once |
||||
|
||||
#include <cstdint> |
||||
|
||||
#ifdef USE_SDL3 |
||||
#include <SDL3/SDL_endian.h> |
||||
#else |
||||
#include <SDL_endian.h> |
||||
#endif |
||||
|
||||
namespace devilution { |
||||
|
||||
constexpr uint16_t Swap16LE(uint16_t val) |
||||
{ |
||||
#ifdef USE_SDL3 |
||||
return SDL_Swap16LE(val); |
||||
#else |
||||
return SDL_SwapLE16(val); |
||||
#endif |
||||
} |
||||
|
||||
constexpr uint32_t Swap32LE(uint32_t val) |
||||
{ |
||||
#ifdef USE_SDL3 |
||||
return SDL_Swap32LE(val); |
||||
#else |
||||
return SDL_SwapLE32(val); |
||||
#endif |
||||
} |
||||
|
||||
} // namespace devilution
|
||||
Loading…
Reference in new issue