pmann84 / cr-cpp-wasm-export

Simple example showing how to build WASM from C++

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cr-cpp-wasm-export

Overview

This repository serves as the example code for the blog post here.

It gives an overview on how one might setup CLion to use Emscripten and export classes to use in the browser.

Getting Started

Open the project in CLion and setup the toolchain as per the instructions in this blogpost.

Running the example in the Browser

You need to copy the two files:

  • lib.js
  • lib.wasm from the build directory to the browser directory. Then you should use something to serve up the html and exported files like Live Server.

About

Simple example showing how to build WASM from C++


Languages

Language:C++ 43.8%Language:HTML 31.5%Language:CMake 24.7%