CMake 2.24.0: Workaround for missing SDL2::SDL2main
This commit is contained in:
parent
d399324677
commit
af7b517f05
1 changed files with 9 additions and 0 deletions
|
@ -58,6 +58,15 @@ if(SDL2_FOUND)
|
||||||
|
|
||||||
mark_as_advanced(SDL2_INCLUDE_DIRS SDL2_LIBRARIES)
|
mark_as_advanced(SDL2_INCLUDE_DIRS SDL2_LIBRARIES)
|
||||||
|
|
||||||
|
if(NOT TARGET SDL2::SDL2main)
|
||||||
|
# In SDL 2.24.0, the CONFIG method doesn't add a target for libSDL2main. Seen on Debian
|
||||||
|
# Unstable, and seems to be https://github.com/libsdl-org/SDL/issues/6119 which is reported
|
||||||
|
# upstream on macOS. For consistency's sake, let's add a phony library we can link with,
|
||||||
|
# which is also the workaround that upstream suggests in the bug report.
|
||||||
|
message(STATUS "SDL2 found via CONFIG, but it didn't define SDL2::SDL2main, adding dummy target")
|
||||||
|
add_library(SDL2::SDL2main INTERFACE IMPORTED)
|
||||||
|
endif()
|
||||||
|
|
||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue