removed Visual Studio specific makefile define MAXOPT in favor of adding more generic define LTO [Oliver Stöneberg]

This commit is contained in:
Oliver Stöneberg 2013-08-02 09:48:25 +00:00
parent f01e531966
commit 171d43ead6
2 changed files with 16 additions and 4 deletions

View File

@ -250,6 +250,9 @@ BUILD_MIDILIB = 1
# specify the sanitizer to use or leave empty to use none # specify the sanitizer to use or leave empty to use none
# SANITIZE = # SANITIZE =
# uncomment next line to enable LTO (link-time optimizations)
# LTO = 1
# specify optimization level or leave commented to use the default # specify optimization level or leave commented to use the default
# (default is OPTIMIZE = 3 normally, or OPTIMIZE = 0 with symbols) # (default is OPTIMIZE = 3 normally, or OPTIMIZE = 0 with symbols)
# OPTIMIZE = 3 # OPTIMIZE = 3
@ -495,6 +498,9 @@ endif
# if we are optimizing, include optimization options # if we are optimizing, include optimization options
ifneq ($(OPTIMIZE),0) ifneq ($(OPTIMIZE),0)
CCOMFLAGS += -fno-strict-aliasing $(ARCHOPTS) CCOMFLAGS += -fno-strict-aliasing $(ARCHOPTS)
ifdef LTO
CCOMFLAGS += -flto
endif
endif endif
# add a basic set of warnings # add a basic set of warnings
@ -603,6 +609,12 @@ LDFLAGS += -s
endif endif
endif endif
ifneq ($(OPTIMIZE),0)
ifdef LTO
LDFLAGS += -flto
endif
endif
# output a map file (emulator only) # output a map file (emulator only)
ifdef MAP ifdef MAP
LDFLAGSEMULATOR += -Wl,-Map,$(FULLNAME).map LDFLAGSEMULATOR += -Wl,-Map,$(FULLNAME).map

View File

@ -129,12 +129,12 @@ else
CCOMFLAGS += /MT CCOMFLAGS += /MT
endif endif
# turn on link-time codegen if the MAXOPT flag is also set # use link-time optimizations when enabled
ifdef MAXOPT ifneq ($(OPTIMIZE),0)
CCOMFLAGS += /GL ifdef LTO
LDFLAGS += /LTCG
AR += /LTCG AR += /LTCG
endif endif
endif
# disable warnings and link against bufferoverflowu for 64-bit targets # disable warnings and link against bufferoverflowu for 64-bit targets
ifeq ($(PTR64),1) ifeq ($(PTR64),1)