Meta: Choose the QEMU display backend based on whats available

This commit is contained in:
Sahan Fernando 2021-06-28 11:05:54 +10:00 committed by Ali Mohammad Pur
parent a939ffc617
commit 16eb0803fc
Notes: sideshowbarker 2024-07-18 11:25:47 +09:00

View File

@ -57,8 +57,13 @@ SERENITY_SCREENS="${SERENITY_SCREENS:-1}"
if uname -a | grep -iq WSL; then
# QEMU for windows does not like gl=on, so detect if we are building in wsl, and if so, disable it
SERENITY_QEMU_DISPLAY_BACKEND="${SERENITY_QEMU_DISPLAY_BACKEND:-sdl,gl=off}"
else
elif ("${SERENITY_QEMU_BIN}" --display help | grep -iq sdl) && (ldconfig -p | grep -iq virglrenderer); then
SERENITY_QEMU_DISPLAY_BACKEND="${SERENITY_QEMU_DISPLAY_BACKEND:-sdl,gl=on}"
elif "${SERENITY_QEMU_BIN}" --display help | grep -iq cocoa; then
# QEMU for OSX seems to only support cocoa
SERENITY_QEMU_DISPLAY_BACKEND="${SERENITY_QEMU_DISPLAY_BACKEND:-cocoa,gl=off}"
else
SERENITY_QEMU_DISPLAY_BACKEND="${SERENITY_QEMU_DISPLAY_BACKEND:-gtk,gl=off}"
fi
if [ "$SERENITY_SCREENS" -gt 1 ]; then