shithub: rgbds

Download patch

ref: 7eb73d766eb0167a77e53393f506bdb5910940dc
parent: bcfeb49d6be4324c30bdb6c95c0cc29ac1b15f2f
author: ISSOtm <eldredhabert0@gmail.com>
date: Thu Apr 2 12:39:22 EDT 2020

Make compilation optimized unless debugging

Note: I wanted to enable `-Og` on `develop`, but this generated warnings
(thus, errors) that aren't in `-O0`. Needs further investigation, but
annoyingly some of those are within `extern/` code, thus requiring
different flags, which AFAIK is only possible (sanely) with GNU Make.

--- a/Makefile
+++ b/Makefile
@@ -32,7 +32,7 @@
 WARNFLAGS	:= -Wall
 
 # Overridable CFLAGS
-CFLAGS		:= -g -O0
+CFLAGS		:= -O3
 # Non-overridable CFLAGS
 REALCFLAGS	:= ${CFLAGS} ${WARNFLAGS} -std=c11 -D_POSIX_C_SOURCE=200809L \
 		   -D_DEFAULT_SOURCE -Iinclude
@@ -224,7 +224,7 @@
 		-fsanitize=unreachable -fsanitize=vla-bound \
 		-fsanitize=signed-integer-overflow -fsanitize=bounds \
 		-fsanitize=object-size -fsanitize=bool -fsanitize=enum \
-		-fsanitize=alignment -fsanitize=null -DDEVELOP=1"
+		-fsanitize=alignment -fsanitize=null -DDEVELOP" CFLAGS="-g -O0"
 
 # Targets for the project maintainer to easily create Windows exes.
 # This is not for Windows users!