mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:37:44 +00:00
Meta: Improve WSL detection for the run.sh script
For users who use a custom kernel with WSL our previous method of detecting WSL doesn't work. This new check instead detects WSL by checking if the wslpath utility is available.
This commit is contained in:
parent
de7f1bfd58
commit
74af43ed97
1 changed files with 2 additions and 2 deletions
|
@ -96,7 +96,7 @@ fi
|
||||||
|
|
||||||
if [ "$(uname)" = "Darwin" ]; then
|
if [ "$(uname)" = "Darwin" ]; then
|
||||||
SERENITY_AUDIO_BACKEND="-audiodev coreaudio,id=snd0"
|
SERENITY_AUDIO_BACKEND="-audiodev coreaudio,id=snd0"
|
||||||
elif (uname -a | grep -iq WSL) || (uname -a | grep -iq microsoft); then
|
elif command -v wslpath >/dev/null; then
|
||||||
SERENITY_AUDIO_BACKEND="-audiodev dsound,id=snd0"
|
SERENITY_AUDIO_BACKEND="-audiodev dsound,id=snd0"
|
||||||
elif "$SERENITY_QEMU_BIN" -audio-help 2>&1 | grep -- "-audiodev id=sdl" >/dev/null; then
|
elif "$SERENITY_QEMU_BIN" -audio-help 2>&1 | grep -- "-audiodev id=sdl" >/dev/null; then
|
||||||
SERENITY_AUDIO_BACKEND="-audiodev sdl,id=snd0"
|
SERENITY_AUDIO_BACKEND="-audiodev sdl,id=snd0"
|
||||||
|
@ -113,7 +113,7 @@ fi
|
||||||
SERENITY_SCREENS="${SERENITY_SCREENS:-1}"
|
SERENITY_SCREENS="${SERENITY_SCREENS:-1}"
|
||||||
if [ "$SERENITY_SPICE" ]; then
|
if [ "$SERENITY_SPICE" ]; then
|
||||||
SERENITY_QEMU_DISPLAY_BACKEND="${SERENITY_QEMU_DISPLAY_BACKEND:-spice-app}"
|
SERENITY_QEMU_DISPLAY_BACKEND="${SERENITY_QEMU_DISPLAY_BACKEND:-spice-app}"
|
||||||
elif (uname -a | grep -iq WSL) || (uname -a | grep -iq microsoft); then
|
elif command -v wslpath >/dev/null; then
|
||||||
# QEMU for windows does not like gl=on, so detect if we are building in wsl, and if so, disable it
|
# QEMU for windows does not like gl=on, so detect if we are building in wsl, and if so, disable it
|
||||||
# Also, when using the GTK backend we run into this problem: https://github.com/SerenityOS/serenity/issues/7657
|
# Also, when using the GTK backend we run into this problem: https://github.com/SerenityOS/serenity/issues/7657
|
||||||
SERENITY_QEMU_DISPLAY_BACKEND="${SERENITY_QEMU_DISPLAY_BACKEND:-sdl,gl=off}"
|
SERENITY_QEMU_DISPLAY_BACKEND="${SERENITY_QEMU_DISPLAY_BACKEND:-sdl,gl=off}"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue