Permalink
Browse files

fix GL and dirent header inclusion on emscripten, define it

  • Loading branch information...
revmischa committed Jun 19, 2014
1 parent b43c00d commit bff9e037afd03408e00b96a1181e7959464ae383
View
@@ -4,3 +4,4 @@ cmake_minimum_required(VERSION 2.8.0)
include(src/cmake/CPack-projectM.cmake)
add_subdirectory(src)
View
@@ -17,6 +17,7 @@ if(EMSCRIPTEN)
SET(INCLUDE-PROJECTM-LIBVISUAL OFF)
SET(INCLUDE-PROJECTM-TEST OFF)
SET(INCLUDE-NATIVE-PRESETS OFF)
ADD_SUBDIRECTORY(projectM-emscripten)
endif(EMSCRIPTEN)
set(PROJECTM_ROOT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
@@ -34,16 +34,20 @@ set(PROJECTM_ABI_LEVEL 2)
#
if (EMSCRIPTEN)
SET(USE_GLES1 ON)
SET(USE_NATIVE_GLEW ON)
SET(USE_GLES1 OFF)
SET(USE_NATIVE_GLEW OFF)
SET(USE_THREADS OFF)
SET(USE_OPENMP OFF)
SET(USE_FTGL OFF)
SET(USE_FBO OFF)
SET(USE_FBO ON)
SET(BUILD_PROJECTM_STATIC ON)
SET(DISABLE_NATIVE_PRESETS ON)
SET(USE_CG OFF)
SET(APPLE )
SET(LINUX )
SET(OPENGL_gl_LIBRARY "fake_gl_lib.a")
SET(GLEW_LIBRARY "gl.symbols")
ADD_DEFINITIONS(-DEMSCRIPTEN)
endif (EMSCRIPTEN)
ADD_DEFINITIONS(-DCMAKE_INSTALL_PREFIX=\"${CMAKE_INSTALL_PREFIX}\")
@@ -146,7 +150,9 @@ else (APPLE)
ADD_DEFINITIONS(-DWIN32 -DSTBI_NO_DDS)
else(WIN32)
set (RESOURCE_PREFIX "share/projectM")
ADD_DEFINITIONS(-DLINUX -DSTBI_NO_DDS)
IF (NOT EMSCRIPTEN)
ADD_DEFINITIONS(-DLINUX -DSTBI_NO_DDS)
ENDIF (NOT EMSCRIPTEN)
endif(WIN32)
set(COREFOUNDATION_LIBRARY )
set(OPENGL_LIBRARIES )
@@ -64,7 +64,11 @@ extern FILE *fmemopen(void *buf, size_t len, const char *pMode);
#ifdef LINUX
#include <cstdlib>
#define projectM_isnan isnan
#endif
#ifdef EMSCRIPTEN
#include <cstdlib>
#define projectM_isnan isnan
#endif
#ifdef WIN32
@@ -13,6 +13,10 @@
#include <dirent.h>
#endif
#ifdef EMSCRIPTEN
#include <dirent.h>
#endif
#ifdef MACOS
#include <dirent.h>
#endif
@@ -34,6 +34,11 @@
#else
#include <GL/glew.h>
#endif
#if EMSCRIPTEN
#include <GL/glew.h>
#endif
#endif
#ifdef MACOS
@@ -9,6 +9,9 @@
#ifdef LINUX
#include <GL/gl.h>
#endif
#ifdef EMSCRIPTEN
#include <GL/gl.h>
#endif
#ifdef WIN32
#include "glew.h"
#endif
@@ -25,6 +25,8 @@
#include <OpenGL/gl.h>
#include <Carbon/Carbon.h>
#define APIENTRY
#elif EMSCRIPTEN
#include <GL/gl.h>
#else
#include <GL/gl.h>
#include <GL/glx.h>
@@ -2010,6 +2012,8 @@ int query_DXT_capability( void )
CFRelease( bundleURL );
CFRelease( extensionName );
CFRelease( bundle );
#elif EMSCRIPTEN
// should something go here? i have no idea
#else
ext_addr = (P_SOIL_GLCOMPRESSEDTEXIMAGE2DPROC)
glXGetProcAddressARB
@@ -1,6 +1,9 @@
#ifdef LINUX
#include <GL/gl.h>
#endif
#ifdef EMSCRIPTEN
#include <GL/gl.h>
#endif
#ifdef WIN32
#include "glew.h"
#endif
@@ -21,6 +24,9 @@
#ifdef LINUX
#include <dirent.h>
#endif
#ifdef EMSCRIPTEN
#include <dirent.h>
#endif
#ifdef MACOS
#include <dirent.h>
@@ -14,6 +14,9 @@
#ifdef __APPLE__
#include <OpenGL/gl.h>
#endif
#ifdef EMSCRIPTEN
#include <GL/gl.h>
#endif
#include "Waveform.hpp"
#include <algorithm>

0 comments on commit bff9e03

Please sign in to comment.