https://github.com/xaliphostes/emsc-example
Show how to use Emscripten
https://github.com/xaliphostes/emsc-example
Last synced: 3 months ago
JSON representation
Show how to use Emscripten
- Host: GitHub
- URL: https://github.com/xaliphostes/emsc-example
- Owner: xaliphostes
- License: mit
- Created: 2018-06-27T12:28:01.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2021-01-11T07:17:14.000Z (over 4 years ago)
- Last Synced: 2025-02-03T14:40:35.703Z (4 months ago)
- Language: CMake
- Size: 5.86 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Definition
Shows how to use emscripten with cmake for a simple or a big project.
`MyLib` is a static library which will generate a `.lib` (under Windows of course).
`Main` will generate a .exe and is linked (statically) to `MyLib`.
`nmake install` will install the exe and the dll in the `bin` directory, and the lib in the `lib` directory.# Generation and installation
1. Generate the build directory
```
mkdir build
```2. Go inside the `build` directory
3. Generate the makefiles
```
cmake -DCMAKE_TOOLCHAIN_FILE="%EMSCRIPTEN%/cmake/Modules/Platform/emscripten.cmake" -G "NMake Makefiles" ..
```4. Compile
```
nmake
```