Merge pull request #296015 from sergv/sdl-setup-hook-improvements

Improve SDL setup hook
This commit is contained in:
Artturi 2024-03-18 16:43:39 +02:00 committed by GitHub
commit 3e00d41b22
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 3 deletions

View File

@ -1,9 +1,15 @@
addSDLPath () {
if [ -e "$1/include/SDL" ]; then
export SDL_PATH="${SDL_PATH-}${SDL_PATH:+ }$1/include/SDL"
fi
if [ -e "$1/lib" ]; then
export SDL_LIB_PATH="${SDL_LIB_PATH-}${SDL_LIB_PATH:+ }-L$1/lib"
# NB this doesnt work with split dev packages because different packages
# will contain "include/SDL/" and "lib/" directories.
#
# However the SDL_LIB_PATH is consumed by SDL itself and serves to locate
# libraries like SDL2_mixer, SDL2_image, etc which are not split-package
# so the check above will only trigger on them.
if [ -e "$1/lib" ]; then
export SDL_LIB_PATH="${SDL_LIB_PATH-}${SDL_LIB_PATH:+ }-L$1/lib"
fi
fi
}