浏览代码

Set optimization level only if not already overridden

Elliot Saba 8 年之前
父节点
当前提交
75ec57d90f
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      Make.inc

+ 4 - 2
Make.inc

@@ -99,8 +99,10 @@ ifeq ($(ARCH),x86_64)
 override ARCH := amd64
 endif
 
-# The optimization flag may be overriden with the environment variable CFLAGS.
-CFLAGS ?= -O3
+# If CFLAGS does not contain a -O optimization flag, default to -O3
+ifeq ($(findstring -O,$(CFLAGS)),)
+CFLAGS_add += -O3
+endif
 
 ifneq (,$(findstring MINGW,$(OS)))
 override OS=WINNT