commit 8cc1c154ecba8f285a30e108e5aaac6ab8f6f1c4 parent 87cf7bb722855afe4311f71f94b3a7954c48df51 Author: Henry Unite <unitehenry@gmail.com> Date: Thu, 16 Apr 2026 04:11:28 +0000 chore: compile raylib wasm Diffstat:
| M | .gitignore | | | 1 | + |
| D | Makefile | | | 13 | ------------- |
| A | scripts/raylib | | | 20 | ++++++++++++++++++++ |
3 files changed, 21 insertions(+), 13 deletions(-)
diff --git a/.gitignore b/.gitignore @@ -1,2 +1,3 @@ build /emsdk +/raylib diff --git a/Makefile b/Makefile @@ -1,13 +0,0 @@ -TARGET_EXEC := rayflap - -BUILD_DIR := ./build -SRC_DIR := ./src - -$(shell mkdir -p $(BUILD_DIR)) - -$(BUILD_DIR)/$(TARGET_EXEC): - gcc $(SRC_DIR)/main.c -o $@ - -.PHONY: clean -clean: - rm -r $(BUILD_DIR) diff --git a/scripts/raylib b/scripts/raylib @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +RETURN_DIR=$(pwd) + +if [[ ! -d ./raylib ]]; then + git clone https://github.com/raysan5/raylib +fi + +cd raylib + +emcc -c src/rcore.c -Os -Wall -DPLATFORM_WEB -DGRAPHICS_API_OPENGL_ES2 +emcc -c src/rshapes.c -Os -Wall -DPLATFORM_WEB -DGRAPHICS_API_OPENGL_ES2 +emcc -c src/rtextures.c -Os -Wall -DPLATFORM_WEB -DGRAPHICS_API_OPENGL_ES2 +emcc -c src/rtext.c -Os -Wall -DPLATFORM_WEB -DGRAPHICS_API_OPENGL_ES2 +emcc -c src/rmodels.c -Os -Wall -DPLATFORM_WEB -DGRAPHICS_API_OPENGL_ES2 +emcc -c src/raudio.c -Os -Wall -DPLATFORM_WEB + +emar rcs libraylib.a rcore.o rshapes.o rtextures.o rtext.o rmodels.o raudio.o + +cd $RETURN_DIR