From 5ce51f7b0be0cba77d2b5af4a215aa443f666dc2 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 12 May 2013 16:02:49 +0200 Subject: [PATCH] (libretro-test-gl iOS) Compiles and links on iOS --- libretro-test-gl/Makefile | 16 +++++++++++++--- libretro-test-gl/libretro-test.c | 7 +++++++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/libretro-test-gl/Makefile b/libretro-test-gl/Makefile index 2ec4542b85..d230f89c1a 100644 --- a/libretro-test-gl/Makefile +++ b/libretro-test-gl/Makefile @@ -12,19 +12,29 @@ else ifneq ($(findstring win,$(shell uname -a)),) endif endif +TARGET_NAME = testgl + ifeq ($(platform), unix) - TARGET := libretro.so + TARGET := $(TARGET_NAME)_libretro.so fpic := -fPIC SHARED := -shared -Wl,--version-script=link.T -Wl,--no-undefined GL_LIB := -lGL else ifeq ($(platform), osx) - TARGET := libretro.dylib + TARGET := $(TARGET_NAME)_libretro.dylib fpic := -fPIC SHARED := -dynamiclib GL_LIB := -framework OpenGL +else ifeq ($(platform), ios) + TARGET := $(TARGET_NAME)_libretro_ios.dylib + fpic := -fPIC + SHARED := -dynamiclib + GL_LIB := -framework OpenGLES + DEFINES := -DIOS + CFLAGS += -DGLES $(DEFINES) + CC = clang -arch armv7 -isysroot $(IOSSDK) else CC = gcc - TARGET := retro.dll + TARGET := $(TARGET_NAME)_retro.dll SHARED := -shared -static-libgcc -static-libstdc++ -s -Wl,--version-script=link.T -Wl,--no-undefined GL_LIB := -lopengl32 CFLAGS += -I.. diff --git a/libretro-test-gl/libretro-test.c b/libretro-test-gl/libretro-test.c index 58b8ce3a77..93e4a60012 100644 --- a/libretro-test-gl/libretro-test.c +++ b/libretro-test-gl/libretro-test.c @@ -10,7 +10,14 @@ static struct retro_hw_render_callback hw_render; #define GL_GLEXT_PROTOTYPES #if defined(GLES) +#ifdef IOS +#include +#else #include +#endif +#elif defined(__APPLE__) +#include +#include #else #include #include