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