Skip to content

Commit

Permalink
Use -sSINGLE_FILE for web examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
badlogic committed Dec 29, 2022
1 parent 8ad68b7 commit fc2ccc8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ elseif(UNIX)
"-sEXPORTED_RUNTIME_METHODS=ccall,cwrap"
"-sASYNCIFY"
"--no-entry"
"-sSINGLE_FILE"
)
else()
target_link_libraries(minifb
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -521,10 +521,9 @@ Download and install [Emscripten](https://emscripten.org/). When configuring you
```bash
cmake -DCMAKE_TOOLCHAIN_FILE=/path/to/emsdk/<version>/emscripten/cmake/Modules/Platform/Emscripten.cmake -S . -B build
cmake --build build
python3 -m http.server --directory build/
```

Then open [http://localhost:8000](http://localhost:8000) in your browser to view the example index.
Then open the file `build/index.html` in your browser to view the example index.

### Integrating a MiniFB app in a website
To build an executable target for the web, you need to add a linker option specifying its module name, e.g.:
Expand Down

2 comments on commit fc2ccc8

@Darky-Lucera
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, do not remove the server explaination, maybe you could explain when and how to use it

@badlogic
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added it back in.

Please sign in to comment.