Skip to content

Recipe / Reference Request #264

Answered by ncruces
chowieuk asked this question in Q&A
Discussion options

You must be logged in to vote

First you need to compile the C/++ to Wasm. I use wasi-sdk and binaryen.

SQLite makes this “easy” by providing a single source file, I double down and use the C preprocessor concat my extra files. Box2D might need a build system (Autotools, CMake); can't really help you much there.

My setup is “simple enough” that I just use a few bash scripts to download, patch, configure, build and optimize the Wasm. You can look at this for a simpler example.

Then there's the actual wrapper. Probably this repo is not the best place to start, I'd start with wazero examples.

SQLite mostly has a straight forward API in that it's not struct based: most functions take ints/floats, pointers to C strings (or …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by chowieuk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants