Skip to content

Commit

Permalink
Merge pull request #12 from tomyun/osx-build
Browse files Browse the repository at this point in the history
Support Mac OS X build
  • Loading branch information
kallisti5 committed Sep 9, 2015
2 parents 68bb7d7 + 66a0ae9 commit d13b045
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 5 deletions.
6 changes: 5 additions & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ if not conf.CheckPKG('sdl2'):
env = conf.Finish()

env.Append(CPPPATH = ['#src/includes/', '#src/engine/'])
env.Append(LIBS = ['-lSDL2_mixer', '-lvorbisfile', '-lGL', '-lGLU'])
env.Append(LIBS = ['-lSDL2_mixer', '-lvorbisfile'])
if env['PLATFORM'] == 'darwin':
env.Append(FRAMEWORKS = ['OpenGL'])
else:
env.Append(LIBS = ['-lGL', '-GLu'])
env.Append(CFLAGS = ['-g'])
env.Append(LINKFLAGS = ['-g'])
env.Append(CPPDEFINES={'VERSION_MAJOR' : '3'})
Expand Down
7 changes: 6 additions & 1 deletion src/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,16 @@ engine_sources = [
'engine/trans_fx.c'
]

if env['PLATFORM'] in ('posix', 'linux', 'freebsd', 'darwin'):
if env['PLATFORM'] in ('posix', 'linux', 'freebsd'):
main_sources += [
'osd_linux_cd.c',
'osd_keyboard.c',
]
elif env['PLATFORM'] in ('darwin'):
main_sources += [
'osd_dummy_cd.c',
'osd_keyboard.c',
]
elif env['PLATFORM'] in ('haiku'):
main_sources += [
'osd_haiku_cd.c',
Expand Down
2 changes: 1 addition & 1 deletion src/engine/lsmp3.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include <stdarg.h>
#include <string.h>
#include <ctype.h>
#if defined(__linux__)
#if defined(__linux__) || defined(__APPLE__)
#include <limits.h>
#endif
#include <assert.h>
Expand Down
2 changes: 1 addition & 1 deletion src/engine/pce.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "config.h"

#if defined(__linux__)
#if defined(__linux__) || defined(__APPLE__)
#include <limits.h>
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/engine/romdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "romdb.h"

#if defined(__linux__)
#if defined(__linux__) || defined(__APPLE__)
#include <limits.h>
#endif
#include <stdlib.h>
Expand Down
4 changes: 4 additions & 0 deletions src/includes/osd_sdl_gfx.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@

#include <SDL.h>
#include <SDL_endian.h>
#if defined(__APPLE__)
#include <OpenGL/glu.h>
#else
#include <GL/glu.h>
#endif

extern uchar *OSD_MESSAGE_SPR;

Expand Down
2 changes: 2 additions & 0 deletions src/osd_sdl_gfx.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,9 @@ osd_gfx_glinit(struct generic_rect* viewport)
glDisable(GL_ALPHA_TEST);
glDisable(GL_BLEND);
glDisable(GL_LIGHTING);
#if !defined(__APPLE__)
glDisable(GL_TEXTURE_3D_EXT);
#endif
glMatrixMode(GL_PROJECTION);
glLoadIdentity();

Expand Down

0 comments on commit d13b045

Please sign in to comment.