Assume ${SDL2_LIBRARIES} if not defined

${SDL2_LIBRARIES} may sometimes not be defined on Arch Linux and this could cause build failure. Also see https://github.com/tsoding/nothing/issues/923.
This commit is contained in:
Ritiek Malhotra 2020-11-17 03:53:06 +05:30 committed by GitHub
parent 5f909d0b91
commit 38aceae807
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,6 +32,10 @@ if (HEADLESS)
else ()
find_package(SDL2 QUIET)
if (SDL2_FOUND)
if ("${SDL2_LIBRARIES}" STREQUAL "")
message(WARNING "SDL2_LIBRARIES wasn't set, manually setting to SDL2::SDL2")
set(SDL2_LIBRARIES "SDL2::SDL2")
endif ()
# Getting complaint about space at the end of this on ubuntu16.
string(STRIP ${SDL2_LIBRARIES} SDL2_LIBRARIES)
else ()