1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-05-07 03:39:35 +00:00

Enable link time optimization only when optimizing

Because it is quite slow, skip it when 'optimize' flag is 'no'

No functional change.
This commit is contained in:
Marco Costalba 2012-09-09 10:02:11 +02:00
parent 2379312028
commit 6e840f8033

View file

@ -321,6 +321,7 @@ endif
### This is a mix of compile and link time options because the lto link phase ### This is a mix of compile and link time options because the lto link phase
### needs access to the optimization flags. ### needs access to the optimization flags.
ifeq ($(comp),gcc) ifeq ($(comp),gcc)
ifeq ($(optimize),yes)
GCC_MAJOR := `$(CXX) -dumpversion | cut -f1 -d.` GCC_MAJOR := `$(CXX) -dumpversion | cut -f1 -d.`
GCC_MINOR := `$(CXX) -dumpversion | cut -f2 -d.` GCC_MINOR := `$(CXX) -dumpversion | cut -f2 -d.`
ifeq (1,$(shell expr \( $(GCC_MAJOR) \> 4 \) \| \( $(GCC_MAJOR) \= 4 \& $(GCC_MINOR) \>= 5 \))) ifeq (1,$(shell expr \( $(GCC_MAJOR) \> 4 \) \| \( $(GCC_MAJOR) \= 4 \& $(GCC_MINOR) \>= 5 \)))
@ -328,6 +329,7 @@ ifeq ($(comp),gcc)
LDFLAGS += $(CXXFLAGS) LDFLAGS += $(CXXFLAGS)
endif endif
endif endif
endif
### ========================================================================== ### ==========================================================================
### Section 4. Public targets ### Section 4. Public targets