Permalink
Browse files

Fixed Darwin build.

  • Loading branch information...
skaslev committed Jul 12, 2012
1 parent 4eb4eff commit 7999e25a218dde4d817d3a9ecacad52fe6c9184a
Showing with 12 additions and 3 deletions.
  1. +8 −3 SConstruct
  2. +4 −0 src/test.c
View
@@ -1,4 +1,4 @@
-import os, shutil
+import os, shutil, platform
env = Environment()
if env.GetOption('clean'):
@@ -10,10 +10,15 @@ else:
print 'Generating gl3w...'
execfile('gl3w_gen.py')
+if platform.system() == 'Darwin':
+ env.Append(FRAMEWORKS=['CoreFoundation', 'GLUT'])
+else:
+ env.Append(LIBS=['glut'])
+
env.Append(CFLAGS=['-Wall', '-O2'])
env.Append(CPPPATH='include')
env.SharedLibrary('lib/gl3w', 'src/gl3w.c')
o = env.Object('src/test', 'src/test.c')
-env.Program('bin/test_static', [o, 'src/gl3w.c'], LIBS='glut')
-env.Program('bin/test_shared', o, LIBS=['gl3w', 'glut'],
+env.Program('bin/test_static', [o, 'src/gl3w.c'])
+env.Program('bin/test_shared', o, LIBS=['gl3w'],
LIBPATH='lib', RPATH=os.path.abspath('lib'))
View
@@ -1,7 +1,11 @@
#include <stdio.h>
#include <stdlib.h>
#include <GL3/gl3w.h>
+#ifdef __APPLE__
+#include <GLUT/glut.h>
+#else
#include <GL/glut.h>
+#endif
static int width = 600, height = 600;

0 comments on commit 7999e25

Please sign in to comment.