add make release which compiles at -O1

This commit is contained in:
UnknownShadow200 2024-08-03 11:07:45 +10:00
parent 11fb4a2b65
commit 68509d6d83
2 changed files with 6 additions and 1 deletions

View file

@ -137,6 +137,9 @@ ifdef TERMINAL
CFLAGS += -DCC_WIN_BACKEND=CC_WIN_BACKEND_TERMINAL -DCC_GFX_BACKEND=CC_GFX_BACKEND_SOFTGPU
LIBS := $(subst mwindows,mconsole,$(LIBS))
endif
ifdef RELEASE
CFLAGS += -O1
endif
default: $(PLAT)
@ -174,6 +177,8 @@ sdl3:
$(MAKE) $(ENAME) SDL3=1
terminal:
$(MAKE) $(ENAME) TERMINAL=1
release:
$(MAKE) $(ENAME) RELEASE=1
# Some builds require more complex handling, so are moved to
# separate makefiles to avoid having one giant messy makefile

View file

@ -19,7 +19,7 @@ GL_FORCE_INLINE void _glPerspectiveDivideVertex(Vertex* vertex) {
/* Convert to NDC (viewport already applied) */
vertex->x = vertex->x * f;
vertex->y = vertex->y * f;
vertex->z = _glFastInvert(vertex->w);
vertex->z = f;
}