A few fixes for the Emscripten WebAssembly build.

This commit is contained in:
Leon Styhre 2022-03-15 17:17:56 +01:00
parent 29501af68f
commit 2fe11bd827
3 changed files with 7 additions and 5 deletions

View file

@ -207,7 +207,7 @@ endif()
if(EMSCRIPTEN) if(EMSCRIPTEN)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s USE_SDL=2 -pthread") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s USE_SDL=2 -pthread")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s INITIAL_MEMORY=33554432 -s ALLOW_MEMORY_GROWTH=1 -s WASM=1 -s ASSERTIONS=1 -s EXIT_RUNTIME=1 -s USE_SDL=2 \ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s INITIAL_MEMORY=33554432 -s ALLOW_MEMORY_GROWTH=1 -s WASM=1 -s ASSERTIONS=1 -s EXIT_RUNTIME=1 -s USE_SDL=2 \
-pthread -s PTHREAD_POOL_SIZE=4 -s DEMANGLE_SUPPORT=1 -s USE_WEBGL2=1 -s FULL_ES2=1 -s ERROR_ON_UNDEFINED_SYMBOLS=1 -s ASYNCIFY \ -pthread -s PTHREAD_POOL_SIZE=4 -s DEMANGLE_SUPPORT=1 -s USE_WEBGL2=1 -s FULL_ES3=1 -s ERROR_ON_UNDEFINED_SYMBOLS=1 -s ASYNCIFY \
--preload-file ${PROJECT_SOURCE_DIR}/resources@/home/web_user/.emulationstation/resources/ \ --preload-file ${PROJECT_SOURCE_DIR}/resources@/home/web_user/.emulationstation/resources/ \
--preload-file ${PROJECT_SOURCE_DIR}/themes/rbsimple-DE@/home/web_user/.emulationstation/themes/rbsimple-DE/ \ --preload-file ${PROJECT_SOURCE_DIR}/themes/rbsimple-DE@/home/web_user/.emulationstation/themes/rbsimple-DE/ \
--preload-file ${PROJECT_SOURCE_DIR}/ROMs@/home/web_user/ROMs/") --preload-file ${PROJECT_SOURCE_DIR}/ROMs@/home/web_user/ROMs/")

View file

@ -116,7 +116,11 @@ GLenum RendererOpenGL::convertTextureType(const TextureType type)
#else #else
case TextureType::BGRA: { return GL_BGRA; } break; case TextureType::BGRA: { return GL_BGRA; } break;
#endif #endif
#if defined(__EMSCRIPTEN__)
case TextureType::RED: { return GL_LUMINANCE; } break;
#else
case TextureType::RED: { return GL_RED; } break; case TextureType::RED: { return GL_RED; } break;
#endif
default: { return GL_ZERO; } default: { return GL_ZERO; }
} }
// clang-format on // clang-format on

View file

@ -18,13 +18,11 @@
#include <SDL2/SDL_events.h> #include <SDL2/SDL_events.h>
#if defined(__APPLE__)
#include <array>
#endif
#if !defined(_WIN64) #if !defined(_WIN64)
#include <unistd.h> #include <unistd.h>
#endif #endif
#include <array>
#include <fcntl.h> #include <fcntl.h>
namespace Utils namespace Utils