Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pepebecker/multi-target-c-project
https://github.com/pepebecker/multi-target-c-project
Last synced: 1 day ago
JSON representation
- Host: GitHub
- URL: https://github.com/pepebecker/multi-target-c-project
- Owner: pepebecker
- Created: 2024-06-30T10:45:42.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-07-01T02:05:16.000Z (5 months ago)
- Last Synced: 2024-07-05T14:18:11.691Z (4 months ago)
- Language: C
- Homepage: https://pepe.asia/multi-target-c-project/
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Multi-Target C Project
This is a personal project to learn how to create a C API with multiple targets such as native and WebAssembly.
## Prerequisites
- **SDL2**
- **SDL2_gfx**
- **Clang** (Recent version which supports the wasm compilation target)## Compile & Run Natively
```bash
make
```## Compile to WebAssembly
```bash
make wasm
```
Now serve the `web` directory locally and open the page in your browser.### Example Server
```bash
cd web # Navigate into the web directory
python3 -m http.server # Start the server
```
Now navigate to `http://localhost:8000` in your browser.