Skip to content

Commit

Permalink
Fix optimized builds
Browse files Browse the repository at this point in the history
  • Loading branch information
HalidOdat committed Sep 14, 2023
1 parent eee44d9 commit 97d9e99
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ if (DEFINED WEB)
-sMAX_WEBGL_VERSION=2
-sALLOW_MEMORY_GROWTH=1
-sDISABLE_EXCEPTION_CATCHING=1
$<$<OR:$<CONFIG:Release>,$<CONFIG:MinSizeRel>>:--closure=1>
# $<$<OR:$<CONFIG:Release>,$<CONFIG:MinSizeRel>>:--closure=1>
$<$<OR:$<CONFIG:Release>,$<CONFIG:MinSizeRel>>:-sLZ4>
$<$<CONFIG:MinSizeRel>:-flto=full>
--preload-file "${ASSETS_DIRECTOY}@assets"
Expand Down
24 changes: 19 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: <https://halidodat.github.io/gate/>

## Compiling to native build
## Local build

Cloning the repository must be done recursively to get the dependecies.

Expand Down Expand Up @@ -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
Expand All @@ -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 |

0 comments on commit 97d9e99

Please sign in to comment.