Also, let's run it on CI.

This commit is contained in:
Henrik Rydgård
2026-05-25 12:51:37 +02:00
parent ff76224191
commit 2cc638a252
3 changed files with 25 additions and 11 deletions
+15 -1
View File
@@ -232,6 +232,13 @@ jobs:
args: make -C libretro -f Makefile -j2 args: make -C libretro -f Makefile -j2
id: clang-libretro id: clang-libretro
- os: ubuntu-latest
extra: loongarch64
cc: gcc
cxx: g++
args: ./b.sh --loongarch64 PPSSPPHeadless
id: loongarch64
- os: macos-latest - os: macos-latest
extra: test extra: test
cc: clang cc: clang
@@ -278,12 +285,19 @@ jobs:
ndk-version: r21e ndk-version: r21e
- name: Install Linux dependencies - name: Install Linux dependencies
if: runner.os == 'Linux' && matrix.extra != 'android' if: runner.os == 'Linux' && matrix.extra != 'android' && matrix.extra != 'loongarch64'
run: | run: |
sudo add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe restricted multiverse" sudo add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe restricted multiverse"
sudo apt-get update -y -qq sudo apt-get update -y -qq
sudo apt-get install libsdl2-dev libgl1-mesa-dev libglu1-mesa-dev libsdl2-ttf-dev libfontconfig1-dev sudo apt-get install libsdl2-dev libgl1-mesa-dev libglu1-mesa-dev libsdl2-ttf-dev libfontconfig1-dev
- name: Install loongarch64 cross-compilation dependencies
if: matrix.extra == 'loongarch64'
run: |
sudo apt-get update -y -qq
sudo apt-get install -y gcc-14-loongarch64-linux-gnu g++-14-loongarch64-linux-gnu binutils-loongarch64-linux-gnu libgl-dev libglu1-mesa-dev
sudo cmake/scripts/setup-loongarch64-cross.sh
- name: Install iOS dependencies - name: Install iOS dependencies
if: matrix.id == 'ios' if: matrix.id == 'ios'
run: | run: |
+9 -9
View File
@@ -14,15 +14,15 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
# No X11 in the sysroot; disable the X11 Vulkan path to avoid include-dir errors. # No X11 in the sysroot; disable the X11 Vulkan path to avoid include-dir errors.
set(USING_X11_VULKAN OFF CACHE BOOL "" FORCE) set(USING_X11_VULKAN OFF CACHE BOOL "" FORCE)
# Bypass find_package(OpenGL REQUIRED). A stub libGL.so is required so that # Use legacy GL preference so find_package(OpenGL) looks for a single libGL.so
# GLEW's static archive can be linked via PLT entries (direct B26 branches to # rather than the GLVND split (libOpenGL.so + libGLX.so), which we don't have.
# address 0 would overflow on LoongArch). # A stub libGL.so + GL headers must be present in the sysroot; they are placed
# # there by cmake/scripts/setup-loongarch64-cross.sh (run once with sudo, or
# Primary: run cmake/scripts/setup-loongarch64-cross.sh (sudo) once — it # automatically by the CI install step).
# installs the stub + GL headers into the sysroot. set(OpenGL_GL_PREFERENCE LEGACY CACHE STRING "" FORCE)
# Fallback: the stub can also sit in <build-dir>/stublibs/libGL.so;
# b.sh --loongarch64 creates this automatically on first run. # b.sh also creates a stub in <build-dir>/stublibs/ as a local fallback so the
set(OPENGL_LIBRARIES GL CACHE STRING "" FORCE) # linker can resolve GL/GLX calls from GLEW's static archive via PLT entries.
set(CMAKE_EXE_LINKER_FLAGS set(CMAKE_EXE_LINKER_FLAGS
"${CMAKE_EXE_LINKER_FLAGS} -L${CMAKE_BINARY_DIR}/stublibs" "${CMAKE_EXE_LINKER_FLAGS} -L${CMAKE_BINARY_DIR}/stublibs"
CACHE STRING "" FORCE) CACHE STRING "" FORCE)
+1 -1
View File
@@ -22,7 +22,7 @@ fi
# GL headers are platform-independent C headers; copy from the host. # GL headers are platform-independent C headers; copy from the host.
echo "Installing GL headers into sysroot..." echo "Installing GL headers into sysroot..."
mkdir -p $SYSROOT/include/GL mkdir -p $SYSROOT/include/GL
for h in gl.h glext.h glcorearb.h; do for h in gl.h glext.h glcorearb.h glu.h; do
[ -f /usr/include/GL/$h ] && cp /usr/include/GL/$h $SYSROOT/include/GL/ && echo " $h" [ -f /usr/include/GL/$h ] && cp /usr/include/GL/$h $SYSROOT/include/GL/ && echo " $h"
done done