Skip to content

Commit 1492ff0

Browse files
authored
Merge pull request #142 from JuliaLang/sf/cflags
Set optimization level only if not already overridden
2 parents 0fa599c + 75ec57d commit 1492ff0

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)