Build without PIB support by default and add flag to enable it

This commit is contained in:
Ivan Epifanov 2021-06-10 13:20:39 +03:00 committed by Ryan C. Gordon
parent a4442476df
commit bbdd08e0b2
4 changed files with 24 additions and 13 deletions

View File

@ -420,6 +420,10 @@ set(SDL_STATIC ${SDL_STATIC_ENABLED_BY_DEFAULT} CACHE BOOL "Build a static versi
dep_option(SDL_STATIC_PIC "Static version of the library should be built with Position Independent Code" OFF "SDL_STATIC" OFF)
set_option(SDL_TEST "Build the test directory" OFF)
if(VITA)
set_option(VIDEO_VITA_PIB "Build with PSVita piglet gles2 support" OFF)
endif()
# General source files
file(GLOB SOURCE_FILES
${SDL2_SOURCE_DIR}/src/*.c
@ -2142,16 +2146,22 @@ elseif(VITA)
set(SOURCE_FILES ${SOURCE_FILES} ${VITA_VIDEO_SOURCES})
set(HAVE_SDL_VIDEO TRUE)
check_include_file(pib.h HAVE_PIGS_IN_BLANKET_H)
if(VIDEO_VITA_PIB)
check_include_file(pib.h HAVE_PIGS_IN_BLANKET_H)
if(HAVE_PIGS_IN_BLANKET_H)
set(SDL_VIDEO_OPENGL_ES2 1)
list(APPEND EXTRA_LIBS
pib
)
if(HAVE_PIGS_IN_BLANKET_H)
set(SDL_VIDEO_OPENGL_ES2 1)
list(APPEND EXTRA_LIBS
pib
)
set(HAVE_VIDEO_VITA_PIB ON)
set(SDL_VIDEO_VITA_PIB 1)
else()
set(HAVE_VIDEO_VITA_PIB OFF)
endif()
endif()
set(SDL_VIDEO_RENDER_VITA_GXM 1)
list(APPEND EXTRA_LIBS

View File

@ -473,6 +473,8 @@
#cmakedefine SDL_IPHONE_KEYBOARD @SDL_IPHONE_KEYBOARD@
#cmakedefine SDL_IPHONE_LAUNCHSCREEN @SDL_IPHONE_LAUNCHSCREEN@
#cmakedefine SDL_VIDEO_VITA_PIB @SDL_VIDEO_VITA_PIB@
#if !defined(__WIN32__) && !defined(__WINRT__)
# if !defined(_STDINT_H_) && !defined(_STDINT_H) && !defined(HAVE_STDINT_H) && !defined(_HAVE_STDINT_H)
typedef unsigned int size_t;

View File

@ -20,8 +20,7 @@
*/
#include "../../SDL_internal.h"
#if SDL_VIDEO_DRIVER_VITA && SDL_VIDEO_OPENGL_ES2
#if SDL_VIDEO_DRIVER_VITA && SDL_VIDEO_VITA_PIB
#include <stdlib.h>
#include <string.h>

View File

@ -38,7 +38,7 @@
#include "SDL_vitakeyboard.h"
#include "SDL_vitamouse_c.h"
#include "SDL_vitaframebuffer.h"
#if SDL_VIDEO_OPENGL_ES2
#if SDL_VIDEO_VITA_PIB
#include "SDL_vitagl_c.h"
#endif
#include <psp2/ime_dialog.h>
@ -62,7 +62,7 @@ VITA_Create()
{
SDL_VideoDevice *device;
SDL_VideoData *phdata;
#if SDL_VIDEO_OPENGL_ES2
#if SDL_VIDEO_VITA_PIB
SDL_GLDriverData *gldata;
#endif
/* Initialize SDL_VideoDevice structure */
@ -79,7 +79,7 @@ VITA_Create()
SDL_free(device);
return NULL;
}
#if SDL_VIDEO_OPENGL_ES2
#if SDL_VIDEO_VITA_PIB
gldata = (SDL_GLDriverData *) SDL_calloc(1, sizeof(SDL_GLDriverData));
if (gldata == NULL) {
@ -130,7 +130,7 @@ VITA_Create()
device->DestroyWindowFramebuffer = VITA_DestroyWindowFramebuffer;
*/
#if SDL_VIDEO_OPENGL_ES2
#if SDL_VIDEO_VITA_PIB
device->GL_LoadLibrary = VITA_GL_LoadLibrary;
device->GL_GetProcAddress = VITA_GL_GetProcAddress;
device->GL_UnloadLibrary = VITA_GL_UnloadLibrary;