Skip to content

Commit 75ec57d

Browse files
committed
Set optimization level only if not already overridden
1 parent 0fa599c commit 75ec57d

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Make.inc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,10 @@ ifeq ($(ARCH),x86_64)
9999
override ARCH := amd64
100100
endif
101101

102-
# The optimization flag may be overriden with the environment variable CFLAGS.
103-
CFLAGS ?= -O3
102+
# If CFLAGS does not contain a -O optimization flag, default to -O3
103+
ifeq ($(findstring -O,$(CFLAGS)),)
104+
CFLAGS_add += -O3
105+
endif
104106

105107
ifneq (,$(findstring MINGW,$(OS)))
106108
override OS=WINNT

0 commit comments

Comments
 (0)