https://github.com/jonwoodring/emscripten-electron-boilerplate
A boilerplate build for creating an Electron project using Emscripten (i.e., develop in C, deploy in JavaScript).
https://github.com/jonwoodring/emscripten-electron-boilerplate
boilerplate c c-plus-plus electron emscripten javascript
Last synced: 5 months ago
JSON representation
A boilerplate build for creating an Electron project using Emscripten (i.e., develop in C, deploy in JavaScript).
- Host: GitHub
- URL: https://github.com/jonwoodring/emscripten-electron-boilerplate
- Owner: jonwoodring
- License: cc0-1.0
- Created: 2017-03-01T01:34:57.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-11T23:08:26.000Z (over 9 years ago)
- Last Synced: 2025-04-06T12:50:25.453Z (about 1 year ago)
- Topics: boilerplate, c, c-plus-plus, electron, emscripten, javascript
- Language: Makefile
- Size: 18.6 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
## A boilerplate Electron project using Emscripten ##
This is a boilerplate build for starting Electron projects
using Emscripten (i.e., C) as the source.
- combination of C and JS as the application source
- Electron for the application package
- Emscripten for compiling
- make for dependency building
- webpack for tree shaking, packing, uglify, watching, and babel of JS
- electron-packager to create binary packages for platforms
Notes
=====
- make sure to do an `npm install` first, of course
- compiling uses `make` and running the tests uses `npm`
- see `Makefile` and `package.json` and configure as necessary
- the default make rule `all` will build an Electron package
- this should test release path building from soup to nuts
- `make lint`, `make cc`, and `make watch` are useful development commands
- `make` expects Emscripten to be installed (i.e., `emcc` is on the `$PATH`)
- I tested on 1.37.3 -- I know that 1.35 doesn't work (there will be an
javascript error when it runs)
- Emscripted C is not run through `babel` -- it's only for JS libraries
- `octal-number-loader` is available in case non-standard octal numbers
appear in the Emscripted C (octals in Javascript have to be 0o0001 now)
- `babel` is configured in `.babelrc`
- `webpack` is configured in `release.config.js` and `debug.config.js`
- an example external code is linked against, using `sqlite3` as the example
- it is fetched from the web and built as a dependency
- if you happen to change how things are compiled *make absolutely sure*
that all of your LLVM bytecode files are compiled with the same -O flag --
otherwise, you'll get lots of fun fatal run-time errors - this includes
external libraries
TODO
====
- maybe add a `make` command that installs `emcc` -- maybe...
---
Use as you see fit, I claim no copyright over this.
