From 97d9e99d22b6211fabd299696081c45870fdd7ae Mon Sep 17 00:00:00 2001 From: Haled Odat <8566042+HalidOdat@users.noreply.github.com> Date: Thu, 14 Sep 2023 21:41:19 +0200 Subject: [PATCH] Fix optimized builds --- CMakeLists.txt | 2 +- README.md | 24 +++++++++++++++++++----- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f3a6ed..2e637bd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -178,7 +178,7 @@ if (DEFINED WEB) -sMAX_WEBGL_VERSION=2 -sALLOW_MEMORY_GROWTH=1 -sDISABLE_EXCEPTION_CATCHING=1 - $<$,$>:--closure=1> + # $<$,$>:--closure=1> $<$,$>:-sLZ4> $<$:-flto=full> --preload-file "${ASSETS_DIRECTOY}@assets" diff --git a/README.md b/README.md index ae7fc9a..c14ab87 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ so it must be installed as well a `c++17` (or greater) compliant `C++` compiler. The latest deployed wasm builds are awailable on: -## Compiling to native build +## Local build Cloning the repository must be done recursively to get the dependecies. @@ -50,13 +50,21 @@ Open directory where the root `CMakeLists.txt` is located with _Visual Studio_ ( ## Compiling to Wasm +Use the `scripts/build_web.sh` script, which automatically installs emscripten sdk and builds the project: + +```bash +./scripts/build_web.sh +``` + +### Manually Install emsdk + Before being able to compile to you must have the [Emscripten SDK][emscripten] installed and sourced (as described in the link). -```console -$ emcmake cmake . -B build-web -$ cmake --build build-web -$ cp web/index.html build-web +```bash +emcmake cmake . -B build-web -DCMAKE_BUILD_TYPE=Release +cmake --build build-web --config Release +cp -r web/* build-web ``` ### Start a server @@ -71,3 +79,9 @@ python -m http.server -d build-web Or upload it to a server. [emscripten]: https://emscripten.org/docs/getting_started/downloads.html + +### Creator + +| Name | Surname | Index | +|--------|----------|---------| +| Haled | Odat | 201516 |