Skip to content

Commit c636618

Browse files
authored
Update Makefile (#4054)
Since the flag CUSTOM_CFLAGS should allow users customize things, in particular the optimization level, I figured it should come after other default ones. Based on: "If you use multiple -O options, with or without level numbers, the last such option is the one that is effective." Source: https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
1 parent 29ac31f commit c636618

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ endif
316316
# -D_GNU_SOURCE access to lots of nonstandard GNU/Linux extension functions
317317
# -Werror=pointer-arith catch unportable code that does direct arithmetic on void pointers
318318
# -fno-strict-aliasing jar_xm.h does shady stuff (breaks strict aliasing)
319-
CFLAGS = -Wall -D_GNU_SOURCE -D$(PLATFORM) -D$(GRAPHICS) -Wno-missing-braces -Werror=pointer-arith -fno-strict-aliasing $(CUSTOM_CFLAGS)
319+
CFLAGS = -Wall -D_GNU_SOURCE -D$(PLATFORM) -D$(GRAPHICS) -Wno-missing-braces -Werror=pointer-arith -fno-strict-aliasing
320320

321321
ifneq ($(RAYLIB_CONFIG_FLAGS), NONE)
322322
CFLAGS += -DEXTERNAL_CONFIG_FLAGS $(RAYLIB_CONFIG_FLAGS)
@@ -449,6 +449,8 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
449449
endif
450450
endif
451451

452+
CFLAGS += $(CUSTOM_CFLAGS)
453+
452454
# Define include paths for required headers: INCLUDE_PATHS
453455
# NOTE: Several external required libraries (stb and others)
454456
#------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)