Build without PIB support by default and add flag to enable it
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 92ed799..83ce7b8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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
diff --git a/include/SDL_config.h.cmake b/include/SDL_config.h.cmake
index 8463f47..0b02cd7 100644
--- a/include/SDL_config.h.cmake
+++ b/include/SDL_config.h.cmake
@@ -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;
diff --git a/src/video/vita/SDL_vitagl.c b/src/video/vita/SDL_vitagl.c
index 2f40e2c..ae6087b 100644
--- a/src/video/vita/SDL_vitagl.c
+++ b/src/video/vita/SDL_vitagl.c
@@ -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>
diff --git a/src/video/vita/SDL_vitavideo.c b/src/video/vita/SDL_vitavideo.c
index b09ab14..5df0fe1 100644
--- a/src/video/vita/SDL_vitavideo.c
+++ b/src/video/vita/SDL_vitavideo.c
@@ -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;