add correct file extension for wasm gamestates

This commit is contained in:
Sebastian Krzyszkowiak 2018-07-06 23:17:09 +02:00
parent 4f64b83e01
commit dba2ef80da
2 changed files with 5 additions and 2 deletions

View file

@ -76,6 +76,7 @@ if(EMSCRIPTEN)
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -s WASM=1")
set(EMSCRIPTEN_USE_FLAGS ${EMSCRIPTEN_USE_FLAGS} -s WASM=1)
set(CMAKE_SHARED_MODULE_SUFFIX ".wasm")
add_definitions(-DLIBSUPERDERPY_WASM=1)
else()
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -s WASM=0")
set(EMSCRIPTEN_USE_FLAGS ${EMSCRIPTEN_USE_FLAGS} -s WASM=0)

View file

@ -27,10 +27,12 @@
#ifdef ALLEGRO_WINDOWS
#define LIBRARY_EXTENSION ".dll"
#elif defined(ALLEGRO_MACOSX)
#define LIBRARY_EXTENSION ".dylib"
#elif defined(__EMSCRIPTEN__)
#if defined(LIBSUPERDERPY_WASM)
#define LIBRARY_EXTENSION ".wasm"
#else
#define LIBRARY_EXTENSION ".js"
#endif
#else
#define LIBRARY_EXTENSION ".so"
#endif