Fixed building on Raspberry Pi

This commit is contained in:
Sam Lantinga
2023-01-13 14:20:57 -08:00
parent 0ed4589ed2
commit bf53183c8b
6 changed files with 44 additions and 13 deletions

View File

@@ -670,6 +670,7 @@ macro(CheckVivante)
find_library(VIVANTE_VDK_LIBRARY VDK REQUIRED)
list(APPEND SDL_EXTRA_LIBS ${VIVANTE_LIBRARY} ${VIVANTE_VDK_LIBRARY})
else()
list(APPEND SDL_PC_CFLAGS -DLINUX -DEGL_API_FB)
list(APPEND SDL_EXTRA_LIBS EGL)
endif(HAVE_VIVANTE_VDK)
endif()
@@ -1095,7 +1096,9 @@ macro(CheckRPI)
set(VIDEO_RPI_LDFLAGS "-Wl,-rpath,/opt/vc/lib")
endif()
listtostr(VIDEO_RPI_INCLUDE_DIRS VIDEO_RPI_INCLUDE_FLAGS "-I")
separate_arguments(VIDEO_RPI_INCLUDE_FLAGS)
listtostr(VIDEO_RPI_LIBRARY_DIRS VIDEO_RPI_LIBRARY_FLAGS "-L")
separate_arguments(VIDEO_RPI_LIBRARY_FLAGS)
cmake_push_check_state()
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${VIDEO_RPI_INCLUDE_FLAGS} ${VIDEO_RPI_LIBRARY_FLAGS}")
@@ -1115,8 +1118,8 @@ macro(CheckRPI)
file(GLOB VIDEO_RPI_SOURCES ${SDL3_SOURCE_DIR}/src/video/raspberry/*.c)
list(APPEND SOURCE_FILES ${VIDEO_RPI_SOURCES})
list(APPEND SDL_EXTRA_LIBS ${VIDEO_RPI_LIBRARIES})
target_compile_options(sdl-build-options INTERFACE ${VIDEO_RPI_INCLUDE_FLAGS} ${VIDEO_RPI_LIBRARY_FLAGS})
list(APPEND SDL_EXTRA_LDFLAGS ${VIDEO_RPI_LDFLAGS})
target_compile_options(sdl-build-options INTERFACE ${VIDEO_RPI_INCLUDE_FLAGS})
list(APPEND SDL_EXTRA_LDFLAGS ${VIDEO_RPI_LIBRARY_FLAGS} ${VIDEO_RPI_LDFLAGS})
endif()
endif()
endmacro()