Files
ppsspp/cmake/Toolchains/aarch64-linux-gnu.cmake
T
libretroadmin 329f30a0c9 Create the libretro GL presets once and run frametests on arm64
The GL contexts' CreateDrawContext made the thin3d presets and ContextReset made them again,
leaking the first set on every context reset. Only ContextReset makes them now.

The software renderer draws the same frame dumps on arm64 as on x86-64, so the frametests run
on the arm64 runner too. b.sh --aarch64 and setup-cross.sh aarch64 give a headless build to run
them under qemu locally.
2026-10-09 09:12:45 +02:00

45 lines
1.9 KiB
CMake

set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR aarch64)
set(CMAKE_C_COMPILER aarch64-linux-gnu-gcc-14)
set(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++-14)
set(CMAKE_ASM_COMPILER aarch64-linux-gnu-gcc-14)
set(CMAKE_FIND_ROOT_PATH /usr/aarch64-linux-gnu)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
# No X11 in the sysroot; disable the X11 Vulkan path to avoid include-dir errors.
set(USING_X11_VULKAN OFF CACHE BOOL "" FORCE)
# Use legacy GL preference so find_package(OpenGL) looks for a single libGL.so
# rather than the GLVND split (libOpenGL.so + libGLX.so), which we don't have.
# A stub libGL.so + GL headers must be present in the sysroot; they are placed
# there by cmake/scripts/setup-cross.sh (run once with sudo, or automatically
# by the CI install step).
set(OpenGL_GL_PREFERENCE LEGACY CACHE STRING "" FORCE)
# b.sh also creates a stub in <build-dir>/stublibs/ as a local fallback so the
# linker can resolve GL/GLX calls from GLEW's static archive via PLT entries.
set(CMAKE_EXE_LINKER_FLAGS
"${CMAKE_EXE_LINKER_FLAGS} -L${CMAKE_BINARY_DIR}/stublibs"
CACHE STRING "" FORCE)
# Allow CMake's compile-check programs to run via QEMU, if it's installed.
# Debian/Ubuntu ship the static binaries in qemu-user-static and the dynamic
# ones in qemu-user; either will do, so take whichever is present.
find_program(QEMU_AARCH64 NAMES qemu-aarch64-static qemu-aarch64)
if(QEMU_AARCH64)
# The /lib symlink is created by the setup script; without it, pass -L
# explicitly so QEMU can find the aarch64 dynamic linker.
if(EXISTS "/lib/ld-linux-aarch64.so.1")
set(CMAKE_CROSSCOMPILING_EMULATOR "${QEMU_AARCH64}" CACHE STRING "" FORCE)
else()
set(CMAKE_CROSSCOMPILING_EMULATOR
"${QEMU_AARCH64};-L;/usr/aarch64-linux-gnu"
CACHE STRING "" FORCE)
endif()
endif()