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.
- Generate the build directory
mkdir build
-
Go inside the
build
directory -
Generate the makefiles
cmake -DCMAKE_TOOLCHAIN_FILE="%EMSCRIPTEN%/cmake/Modules/Platform/emscripten.cmake" -G "NMake Makefiles" ..
- Compile
nmake