fix Windows release build

This commit is contained in:
asrael 2026-04-12 17:43:43 -05:00
parent d914f2ea62
commit 19ae869769

View file

@ -80,9 +80,11 @@ ifeq ($(MODE),release)
-O3 -flto -ffast-math -funroll-loops \
-fno-unwind-tables -fno-asynchronous-unwind-tables
LDFLAGS = -flto
STRIP = true
else
CFLAGS = -std=c23 -Wall -Wextra -Wno-missing-braces -g -O1 -DDEBUG
LDFLAGS =
STRIP = false
endif
DEP_CFLAGS = -O3 -funroll-loops -MMD -MP
@ -90,9 +92,13 @@ CFLAGS += -MMD -MP
# -- Linker -------------------------------------------------------------------
MOLD := $(shell command -v mold 2>/dev/null)
ifdef MOLD
ifeq ($(PLATFORM),windows)
LDFLAGS += -fuse-ld=lld
else
MOLD := $(shell command -v mold 2>/dev/null)
ifdef MOLD
LDFLAGS += -fuse-ld=mold
endif
endif
ifeq ($(PLATFORM),windows)
@ -347,6 +353,9 @@ ifeq ($(PLATFORM),windows)
@cp -u $(SDL3_BUILD_DIR)/SDL3.dll $(BINDIR)/
else
@$(CC) $(LDFLAGS) $(ALL_OBJS) $(SHADER_OBJS) $(LUAJIT_LIB) $(LIBS) -o $@
endif
ifeq ($(STRIP),true)
@llvm-strip $@
endif
$(INFO) "Built pxl8 -> $@"