makefile: Don't apply '-march=native' if DISABLE_CXX_OPTIMIZATIONS is specified.

This brings it in line with CmakeLists.txt.
pull/354/head
Marius Bakke 2016-12-30 01:59:18 +01:00
parent 5a5c633073
commit 2ea9ba1bc1
1 changed files with 3 additions and 2 deletions

View File

@ -49,8 +49,6 @@ IS_X86 := $(shell isainfo -k 2>/dev/null | grep -i -c "i386")
IS_X64 := $(shell isainfo -k 2>/dev/null | grep -i -c "amd64") IS_X64 := $(shell isainfo -k 2>/dev/null | grep -i -c "amd64")
endif endif
DISABLE_CXXFLAGS_OPTIMIZATIONS := 0
########################################################### ###########################################################
##### General Variables ##### ##### General Variables #####
########################################################### ###########################################################
@ -130,6 +128,8 @@ endif
# BEGIN MARCH_CXXFLAGS # BEGIN MARCH_CXXFLAGS
# Guard use of -march=native (or -m{32|64} on some platforms) # Guard use of -march=native (or -m{32|64} on some platforms)
# Don't add anything if -march=XXX or -mtune=XXX is specified # Don't add anything if -march=XXX or -mtune=XXX is specified
# or DISABLE_CXXFLAGS_OPTIMIZATIONS is set.
ifeq ($(DISABLE_CXXFLAGS_OPTIMIZATIONS),)
ifeq ($(findstring -march,$(CXXFLAGS)),) ifeq ($(findstring -march,$(CXXFLAGS)),)
ifeq ($(findstring -mtune,$(CXXFLAGS)),) ifeq ($(findstring -mtune,$(CXXFLAGS)),)
ifeq ($(GCC42_OR_LATER)$(IS_NETBSD),10) ifeq ($(GCC42_OR_LATER)$(IS_NETBSD),10)
@ -149,6 +149,7 @@ ifeq ($(findstring -mtune,$(CXXFLAGS)),)
endif endif
endif # -mtune endif # -mtune
endif # -march endif # -march
endif # DISABLE_CXXFLAGS_OPTIMIZATIONS
# END MARCH_CXXFLAGS # END MARCH_CXXFLAGS
# Aligned access required for -O3 and above due to vectorization # Aligned access required for -O3 and above due to vectorization