mirror of
https://github.com/Interlisp/maiko.git
synced 2026-02-28 17:19:20 +00:00
Try to unify cmake file for different versions of SDL2.
This commit is contained in:
@@ -77,10 +77,15 @@ ENDIF()
|
||||
OPTION(MAIKO_DISPLAY_SDL "Use SDL for display." ON)
|
||||
IF(MAIKO_DISPLAY_SDL)
|
||||
FIND_PACKAGE(SDL2 REQUIRED)
|
||||
if(TARGET SDL2::SDL2)
|
||||
set(SDLNAME SDL2::SDL2)
|
||||
elseif(target SDL)
|
||||
set(SDLNAME SDL2)
|
||||
endif()
|
||||
SET(MAIKO_DISPLAY_SDL_DEFINITIONS
|
||||
"-DSDL"
|
||||
)
|
||||
SET(MAIKO_DISPLAY_SDL_LIBRARIES SDL2::SDL2)
|
||||
SET(MAIKO_DISPLAY_SDL_LIBRARIES ${SDLNAME})
|
||||
SET(MAIKO_DISPLAY_SDL_SRCS
|
||||
src/sdl.c
|
||||
)
|
||||
@@ -424,7 +429,7 @@ IF(MAIKO_DISPLAY_SDL)
|
||||
# Tell it that the SDL launcher is available.
|
||||
TARGET_COMPILE_DEFINITIONS(lde PUBLIC ${MAIKO_DISPLAY_SDL_DEFINITIONS})
|
||||
# This is needed so that it can call XOpenDisplay.
|
||||
TARGET_LINK_LIBRARIES(lde SDL2::SDL2)
|
||||
TARGET_LINK_LIBRARIES(lde ${SDLNAME})
|
||||
ENDIF()
|
||||
|
||||
ADD_EXECUTABLE(ldeether src/ldeether.c src/dlpi.c)
|
||||
|
||||
Reference in New Issue
Block a user