From 7790f7a444cd9a6c62745bcfc8566e5ba794b16d Mon Sep 17 00:00:00 2001 From: Omar Rizwan Date: Tue, 18 Jun 2024 22:18:49 -0400 Subject: [PATCH] Fix test build on Mac --- Makefile | 2 ++ README.md | 2 +- test/gl20/gl20_renderer.c | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f177c96..903138e 100644 --- a/Makefile +++ b/Makefile @@ -70,6 +70,8 @@ $(BUILD_DIR)/test/%.o: test/%.c $(TEST_FILE): $(LIB_FILE) $(TEST_OBJS) ifeq ($(OS),Windows_NT) $(CC) -o $@ $(TEST_OBJS) $(LIB_FILE) -lglew32 -lopengl32 -lSDL2 -lSDL2main -lm +else ifeq ($(shell uname -s),Darwin) + $(CC) -o $@ $(TEST_OBJS) $(LIB_FILE) -framework OpenGL -lGLEW -lSDL2 -lSDL2main -lm -lpthread else $(CC) -o $@ $(TEST_OBJS) $(LIB_FILE) -lGLEW -lGL -lSDL2 -lSDL2main -lm -lpthread endif diff --git a/README.md b/README.md index 2aa3865..312d4f4 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ project under the `test` directory as well, demonstrating usage of the library. - [Godot add-on](https://github.com/Brawmario/libsm64-godot) - [Game Maker 8 extension](https://github.com/headshot2017/libsm64-gm8) -## Building on Linux +## Building on Mac and Linux - Ensure python3 is installed. - Ensure the SDL2 and GLEW libraries are installed if you're building the test program (on Ubuntu: libsdl2-dev, libglew-dev). diff --git a/test/gl20/gl20_renderer.c b/test/gl20/gl20_renderer.c index d9de645..3838aa9 100644 --- a/test/gl20/gl20_renderer.c +++ b/test/gl20/gl20_renderer.c @@ -1,5 +1,6 @@ #include "gl20_renderer.h" +#include #include #include "../../src/libsm64.h"