cmake: always create SDL2::SDL2main target in autotools' cmake config script

This commit is contained in:
Anonymous Maarten 2022-08-24 04:14:52 +02:00 committed by Sam Lantinga
parent dc2ef31c29
commit 5eb0f4328d
1 changed files with 29 additions and 28 deletions

View File

@ -62,6 +62,8 @@ string(REGEX REPLACE ";-L" ";" _sdl2_static_private_libdirs "${_sdl2_static_priv
if(_sdl2_libraries MATCHES ".*SDL2main.*")
list(INSERT SDL2_LIBRARIES 0 SDL2::SDL2main)
list(INSERT SDL2_STATIC_LIBRARIES 0 SDL2::SDL2main)
endif()
set(_sdl2main_library ${SDL2_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2main${CMAKE_STATIC_LIBRARY_SUFFIX})
if(EXISTS "${_sdl2main_library}")
set(SDL2MAIN_LIBRARY SDL2::SDL2main)
@ -93,7 +95,6 @@ if(_sdl2_libraries MATCHES ".*SDL2main.*")
set(SDL2_SDL2main_FOUND FALSE)
endif()
unset(_sdl2main_library)
endif()
# Remove SDL2 since this is the "central" library
# Remove SDL2main since this will be provided by SDL2::SDL2main (if available)