FindSDL: add SDLMAIN_LIBRARY only once (#13262)

This commit is contained in:
Rolf Eike Beer 2012-09-09 16:08:45 +02:00
parent eb8b0bea6f
commit adf705863c
1 changed files with 5 additions and 3 deletions

View File

@ -133,10 +133,12 @@ endif()
if(SDL_LIBRARY_TEMP) if(SDL_LIBRARY_TEMP)
# For SDLmain # For SDLmain
if(NOT SDL_BUILDING_LIBRARY) if(SDLMAIN_LIBRARY AND NOT SDL_BUILDING_LIBRARY)
if(SDLMAIN_LIBRARY) list(FIND SDL_LIBRARY_TEMP "${SDLMAIN_LIBRARY}" _SDL_MAIN_INDEX)
set(SDL_LIBRARY_TEMP ${SDLMAIN_LIBRARY} ${SDL_LIBRARY_TEMP}) if(_SDL_MAIN_INDEX EQUAL -1)
list(APPEND SDL_LIBRARY_TEMP "${SDLMAIN_LIBRARY}")
endif() endif()
unset(_SDL_MAIN_INDEX)
endif() endif()
# For OS X, SDL uses Cocoa as a backend so it must link to Cocoa. # For OS X, SDL uses Cocoa as a backend so it must link to Cocoa.