mirror of
https://github.com/sockspls/badfish
synced 2025-05-05 19:09: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:
parent
2379312028
commit
6e840f8033
1 changed files with 7 additions and 5 deletions
12
src/Makefile
12
src/Makefile
|
@ -321,11 +321,13 @@ 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)
|
||||||
GCC_MAJOR := `$(CXX) -dumpversion | cut -f1 -d.`
|
ifeq ($(optimize),yes)
|
||||||
GCC_MINOR := `$(CXX) -dumpversion | cut -f2 -d.`
|
GCC_MAJOR := `$(CXX) -dumpversion | cut -f1 -d.`
|
||||||
ifeq (1,$(shell expr \( $(GCC_MAJOR) \> 4 \) \| \( $(GCC_MAJOR) \= 4 \& $(GCC_MINOR) \>= 5 \)))
|
GCC_MINOR := `$(CXX) -dumpversion | cut -f2 -d.`
|
||||||
CXXFLAGS += -flto
|
ifeq (1,$(shell expr \( $(GCC_MAJOR) \> 4 \) \| \( $(GCC_MAJOR) \= 4 \& $(GCC_MINOR) \>= 5 \)))
|
||||||
LDFLAGS += $(CXXFLAGS)
|
CXXFLAGS += -flto
|
||||||
|
LDFLAGS += $(CXXFLAGS)
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue