Commit 60890753 authored by ForkCreativeMedia's avatar ForkCreativeMedia

Update README.md

parent 11dddae1
......@@ -2,4 +2,63 @@
In this repository we provide some simple examples on how to use Emscripten to bring C++ code to JavaScript/WebAssembly.
For more information about Emscripten visit: https://emscripten.org
\ No newline at end of file
For more information about Emscripten visit: https://emscripten.org
# Creating the web demos
First make sure you have the Emscripten toolchain correctly installed. This includes that the environment variables are set correctly.
Download or clone this repository. Navigate to the basic_web_demos folder in your terminal and type:
```powershell
#Create BUILD and BUILD_INSTALL directories and navigate to the BUILD folder.
mkdir BUILD
mkdir BUILD_INSTALL
cd BUILD
#Create the build files for the basic web demos (JavaScript only):
emcmake cmake .. -DCMAKE_INSTALL_PREFIX="../BUILD_INSTALL"
#Linux build and install
make install
#Windows build and install
mingw32-make.exe install
#Platform independant build and install
cmake --build . --target install
```
**Configuration options:**
- If you want to create a WebAssembly build add `-DBUILD_WASM=ON` to the emcmake command.
# Testing the web demos
Open the HTML demos from the `BUILD_INSTALL/bin` directory inside your browser. The simple demos should work without starting a local web server if you created a JavaScript only build.
In case you build to WebAssembly you should launch a local web server. For this you can use the following tool provided by emscripten:
```python
#This launches a local web server and runs the firefox browser displaying the content from the ../BUILD_INSTALL/bin directory.
#(Assuming you're still inside the BUILD directory).
emrun --browser firefox ../BUILD_INSTALL/bin
#Click on the HTML page you wish to view.
```
# Dependencies
**Required:**
- Emscripten is needed to create the web build. Emscripten is is available under 2 licenses, the MIT license and the
University of Illinois/NCSA Open Source License.
# License
This collection of source code is licensed under the MIT license.
Copyright (c) 2019 [ForK contributors](https://skylab.vc.h-brs.de/fork-project/fork_documentation/blob/master/FORK_CONTRIBUTORS.md).
# Acknowledgements
The project was funded by the European Regional Development Fund (EFRE).
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment