Fix building issues on some mac systems
MODIFY
Makefile
Makefile
@@ -82,7 +82,7 @@ else ifeq ($(UNAME),Darwin)
# Mac
LIBEXT=dylib
CFLAGS += -m$(MARCH) -I include -I /usr/local/include -I /usr/local/opt/libjpeg-turbo/include \
- -I /usr/local/opt/jpeg-turbo/include -I /usr/local/opt/sdl2/include/SDL2 -I /usr/local/opt/libvorbis/include \
+ -I /usr/local/opt/jpeg-turbo/include -I /usr/local/opt/sdl2/include -I /usr/local/opt/libvorbis/include \
-I /usr/local/opt/openal-soft/include -Dopenal_soft -DGL_SILENCE_DEPRECATION
LFLAGS += -Wl,-export_dynamic -L/usr/local/lib

MODIFY
libs/sdl/gl.c
libs/sdl/gl.c
# include <OpenGLES/ES3/gl.h>
# define HL_GLES
#elif defined(HL_MAC)
-# include <SDL.h>
+# include <SDL2/SDL.h>
# include <OpenGL/gl3.h>
# define glBindImageTexture(...) hl_error("Not supported on OSX")
# define glDispatchCompute(...) hl_error("Not supported on OSX")

MODIFY
libs/sdl/sdl.c
libs/sdl/sdl.c
#if defined(_WIN32) || defined(__ANDROID__) || defined(HL_IOS) || defined(HL_TVOS)
# include <SDL.h>
# include <SDL_syswm.h>
-#elif defined(HL_MAC)
-# include <SDL.h>
#else
# include <SDL2/SDL.h>
#endif

MODIFY
other/cmake/FindSDL2.cmake
other/cmake/FindSDL2.cmake
@@ -76,12 +76,21 @@ SET(SDL2_SEARCH_PATHS
${SDL2_PATH}
)
+if (APPLE)
+ FIND_PATH(SDL2_INCLUDE_DIR SDL2/SDL.h
+ HINTS
+ $ENV{SDL2DIR}
+ PATH_SUFFIXES include/SDL2 include
+ PATHS ${SDL2_SEARCH_PATHS}
+ )
+else()
FIND_PATH(SDL2_INCLUDE_DIR SDL.h
HINTS
$ENV{SDL2DIR}
PATH_SUFFIXES include/SDL2 include
PATHS ${SDL2_SEARCH_PATHS}
)
+endif()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(PATH_SUFFIXES lib64 lib/x64 lib)

Fix building issues on some mac systems (#570)