From 016a83faf62e27298729fc741fbcc0e5073a84c7 Mon Sep 17 00:00:00 2001 From: Jesper Jensen Date: Fri, 26 Sep 2025 18:26:44 +0200 Subject: Include cglm as submodule --- .gitmodules | 3 +++ Makefile | 6 +++--- src/main.c | 2 +- thirdparty/cglm | 1 + 4 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 .gitmodules create mode 160000 thirdparty/cglm diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..7576d0b --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "thirdparty/cglm"] + path = thirdparty/cglm + url = https://github.com/recp/cglm.git diff --git a/Makefile b/Makefile index 9b2c9d7..161b034 100644 --- a/Makefile +++ b/Makefile @@ -3,11 +3,11 @@ CC ?= gcc SRCDIR ?= src OBJDIR ?= obj -LIBS = $(shell pkg-config --libs SDL2) -Wl,-rpath,./SDL/build/ $(shell pkg-config --libs cglm) -INCS = -ISDL/build/include/SDL2 -ISDL/build/include-config-/SDL2 +LIBS = -lm +INCS = -Ithirdparty/cglm/include CFLAGS ?= -D_FORTIFY_SOURCE=2 -Wall -Werror -Wno-error=unused-variable -g -Og -CFLAGS += -std=gnu11 -fms-extensions -flto $(shell pkg-config --cflags cglm) +CFLAGS += -std=gnu11 -fms-extensions -flto APP_SOURCES = $(shell find $(SRCDIR) -name "*.c") APP_OBJS = $(APP_SOURCES:%.c=$(OBJDIR)/%.o) diff --git a/src/main.c b/src/main.c index e7216a7..c684edf 100644 --- a/src/main.c +++ b/src/main.c @@ -979,7 +979,7 @@ candidate_found: ; } - double *params = malloc(sizeof(double) * (sizeof(components[0])/sizeof(components))); + double *params = malloc(sizeof(double) * (sizeof(constraints)/sizeof(constraints[0]))); for(size_t i = 0; i < sizeof(constraints)/sizeof(constraints[0]); i++) { params[i] = constraints[i].v; } diff --git a/thirdparty/cglm b/thirdparty/cglm new file mode 160000 index 0000000..a4602f2 --- /dev/null +++ b/thirdparty/cglm @@ -0,0 +1 @@ +Subproject commit a4602f2d5f1f275c02ef608ef27d4021572d9d6c -- cgit v1.2.3