diff --git a/README.md b/README.md index 0776bcb..2f736c1 100644 --- a/README.md +++ b/README.md @@ -96,8 +96,7 @@ Finally this binary is executed securely in an asynchronous WebWorker. The WebWo ## "Backend" Development ### SplashKit Wasm Library Manual Compilation (JavaScript backend) - -First you'll need to install Emscripten, which will be used to compile SplashKit to Wasm so it can be used in the browser. The easiest way to do this is via the `emsdk`. Installation instructions are here - [Getting Started](https://emscripten.org/docs/getting_started/downloads.html) +First, install Emscripten version 3.1.48, which is required to successfully build the SplashKit core and compile it to Wasm for browser use. The easiest way to do this is via the `emsdk`. Installation instructions are here - [Getting Started](https://emscripten.org/docs/getting_started/downloads.html) Once you've got Emscripten installed and activated, you can compile the SplashKit Wasm library! We've included SplashKit's source code as a submodule, along with the scripts to compile it as a Wasm library, directly in this repo. @@ -111,6 +110,8 @@ emmake make If all goes well, you should find the three files built and copied to inside `Browser_IDE/runtimes/javascript/bin/` and `Browser_IDE/splashkit/` - if so, you're done! +**Note:** Placing the project in a path with spaces can lead to errors during the build process. + ### SplashKit Compiler Library Manual Compilation (C++ backend) It is also possible to use C++ within SplashKit Online! This is still experimental, and as such is missing some features and can be a bit unstable. However, the majority of graphics, audio, and input functionality works, and you can use it to compile and test regular C++ programs too! diff --git a/SplashKitWasm/cmake/CMakeLists.txt b/SplashKitWasm/cmake/CMakeLists.txt index cb9c0a6..c333e60 100644 --- a/SplashKitWasm/cmake/CMakeLists.txt +++ b/SplashKitWasm/cmake/CMakeLists.txt @@ -169,6 +169,7 @@ file(GLOB SOURCE_FILES "${SK_EXT}/sqlite/sqlite3.c" "${SK_EXT}/hash-library/*.cpp" "${SK_EXT}/easyloggingpp/*.cc" + "${SK_EXT}/microui/src/*.c" ) if (EMSCRIPTEN) @@ -204,6 +205,7 @@ include_directories("${SK_EXT}/hash-library") include_directories("${SK_EXT}/json") include_directories("${SK_EXT}/sqlite") include_directories("${SK_EXT}/catch") +include_directories("${SK_EXT}/microui/src") include_directories("${SK_WASMEXT}/src/lib") # MAC OS AND WINDOWS DIRECTORY INCLUDES @@ -345,7 +347,7 @@ set_target_properties(SplashKitBackendCXX if (EMSCRIPTEN) if (ENABLE_JS_BACKEND) add_executable(SplashKitBackendWASM "${SK_WASMEXT}/generated/SplashKitWasmGlue.cpp") - set_target_properties(SplashKitBackendWASM PROPERTIES LINK_FLAGS "-sALLOW_TABLE_GROWTH -s MAXIMUM_MEMORY=1gb -sALLOW_MEMORY_GROWTH -s EXPORTED_RUNTIME_METHODS=addFunction -s EXPORTED_FUNCTIONS=\"['_malloc','stackAlloc','stackSave','stackRestore','_free']\" -s EXPORT_ALL=1 -sFS_DEBUG --post-js ${SK_WASMEXT}/generated/SplashKitWasmGlue.js") + set_target_properties(SplashKitBackendWASM PROPERTIES LINK_FLAGS "-sALLOW_TABLE_GROWTH -s MAXIMUM_MEMORY=1gb -sALLOW_MEMORY_GROWTH -s EXPORTED_RUNTIME_METHODS=addFunction -s EXPORTED_FUNCTIONS=\"['_malloc','stackAlloc','stackSave','stackRestore','_free']\" -s EXPORT_ALL=1 -sFS_DEBUG --post-js \"${SK_WASMEXT}\"/generated/SplashKitWasmGlue.js") target_link_libraries(SplashKitBackendWASM SplashKitBackend) #NOTE: deliberately using SplashKitBackend rather than SplashKitBackendCXX - we don't care about the final linked output, we just want Emscripten to give us its JS runtime set_target_properties(SplashKitBackendWASM PROPERTIES diff --git a/SplashKitWasm/external/splashkit-core b/SplashKitWasm/external/splashkit-core index 2031527..021c83f 160000 --- a/SplashKitWasm/external/splashkit-core +++ b/SplashKitWasm/external/splashkit-core @@ -1 +1 @@ -Subproject commit 203152733fdd1db0a870bee906e0913e22f291c1 +Subproject commit 021c83f9aa8f08d5492fb8bc50bda6ad93911fbd diff --git a/SplashKitWasm/tools/js_binding_gen/javascript_bindings_preamble.py b/SplashKitWasm/tools/js_binding_gen/javascript_bindings_preamble.py index 06431c0..0f66186 100644 --- a/SplashKitWasm/tools/js_binding_gen/javascript_bindings_preamble.py +++ b/SplashKitWasm/tools/js_binding_gen/javascript_bindings_preamble.py @@ -49,6 +49,7 @@ #include "web_client.h" #include "web_server.h" #include "window_manager.h" +#include "interface.h" #include #include