add BUILD_NATIVE option to the makefiles. This will squeeze a bit more out of gcc when optimising for your machine. Only really useful for people doing their own builds but it does seem to make a difference on my machine at least

This commit is contained in:
tmaul 2020-05-21 00:23:36 +01:00
parent 95973d12ad
commit 5f1819939b
5 changed files with 24 additions and 0 deletions

View File

@ -24,6 +24,9 @@ UNICODE = 1
# Include x86 Assembly routines
BUILD_X86_ASM = 1
# Include GCC optmisations for your CPU e.g use -march=native. WARNING: This might mean that the generated binaries will not run on other peoples (older) machines!
#BUILD_NATIVE = 1
# Build for x64 targets (MinGW64 and MSVC only, this will undefine BUILD_A68K and BUILD_X86_ASM)
#BUILD_X64_EXE = 1

View File

@ -270,6 +270,12 @@ ifdef BUILD_X86_ASM
CXXFLAGS += -mmmx
endif
ifdef BUILD_NATIVE
CFLAGS += -march=native -mtune=native
CXXFLAGS += -march=native -mtune=native
endif
# For zlib
DEF := $(DEF) -DNO_VIZ -D_LARGEFILE64_SOURCE=0 -D_FILE_OFFSET_BITS=32

View File

@ -379,6 +379,11 @@ ifdef BUILD_X86_ASM
CXXFLAGS += -mmmx
endif
ifdef BUILD_NATIVE
CFLAGS += -march=native -mtune=native
CXXFLAGS += -march=native -mtune=native
endif
# For zlib
DEF := $(DEF) -DNO_VIZ -D_LARGEFILE64_SOURCE=0 -D_FILE_OFFSET_BITS=32

View File

@ -256,6 +256,11 @@ else
LDFLAGS += -s
endif
ifdef BUILD_NATIVE
CFLAGS += -march=native -mtune=native
CXXFLAGS += -march=native -mtune=native
endif
# For zlib
DEF := $(DEF) -DNO_VIZ -D_LARGEFILE64_SOURCE=0 -D_FILE_OFFSET_BITS=32

View File

@ -277,6 +277,11 @@ else
LDFLAGS += -s
endif
ifdef BUILD_NATIVE
CFLAGS += -march=native -mtune=native
CXXFLAGS += -march=native -mtune=native
endif
# For zlib
DEF := $(DEF) -DNO_VIZ -D_LARGEFILE64_SOURCE=0 -D_FILE_OFFSET_BITS=32