iOS support (thanks Caleb!)
authorEthan Lee <flibitijibibo@flibitijibibo.com>
Mon, 18 Feb 2019 21:49:03 -0500
changeset 1192 706e4d246ca1
parent 1191 f2ecd5032ffe
child 1193 4decf307c228
iOS support (thanks Caleb!)
CMakeLists.txt
mojoshader_internal.h
mojoshader_opengl.c
--- a/CMakeLists.txt	Mon Feb 18 21:48:09 2019 -0500
+++ b/CMakeLists.txt	Mon Feb 18 21:49:03 2019 -0500
@@ -94,7 +94,9 @@
 ENDIF(COMPILER_SUPPORT)
 
 IF(APPLE)
-    find_library(CARBON_FRAMEWORK Carbon)  # Stupid Gestalt.
+    IF(NOT IOS)
+        find_library(CARBON_FRAMEWORK Carbon)  # Stupid Gestalt.
+    ENDIF(NOT IOS)
 ENDIF(APPLE)
 
 IF(NOT PROFILE_D3D)
--- a/mojoshader_internal.h	Mon Feb 18 21:48:09 2019 -0500
+++ b/mojoshader_internal.h	Mon Feb 18 21:49:03 2019 -0500
@@ -23,10 +23,6 @@
 #define DEBUG_TOKENIZER \
     (DEBUG_PREPROCESSOR || DEBUG_ASSEMBLER_PARSER || DEBUG_LEXER)
 
-#if (defined(__APPLE__) && defined(__MACH__))
-#define PLATFORM_MACOSX 1
-#endif
-
 // This is the highest shader version we currently support.
 
 #define MAX_SHADER_MAJOR 3
--- a/mojoshader_opengl.c	Mon Feb 18 21:48:09 2019 -0500
+++ b/mojoshader_opengl.c	Mon Feb 18 21:49:03 2019 -0500
@@ -20,8 +20,11 @@
 #endif
 
 #if (defined(__APPLE__) && defined(__MACH__))
+#include "TargetConditionals.h"
+#if !TARGET_OS_IPHONE && !TARGET_OS_TV
 #define PLATFORM_MACOSX 1
-#endif
+#endif /* !TARGET_OS_IPHONE && !TARGET_OS_TV */
+#endif /* (defined(__APPLE__) && defined(__MACH__)) */
 
 #if PLATFORM_MACOSX
 #include <Carbon/Carbon.h>