]> git.sesse.net Git - stockfish/commitdiff
Enable link time optimization only when optimizing
authorMarco Costalba <mcostalba@gmail.com>
Sun, 9 Sep 2012 08:02:11 +0000 (10:02 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Sun, 9 Sep 2012 08:02:11 +0000 (10:02 +0200)
Because it is quite slow, skip it when 'optimize' flag is 'no'

No functional change.

src/Makefile

index 3fd601ffe20c96cee61c94c1ab9ec5e2a8aa2078..2ad22de41bb55011e5d8baebec2a242c47ca1f5a 100644 (file)
@@ -321,11 +321,13 @@ endif
 ### This is a mix of compile and link time options because the lto link phase
 ### needs access to the optimization flags.
 ifeq ($(comp),gcc)
-       GCC_MAJOR := `$(CXX) -dumpversion | cut -f1 -d.`
-       GCC_MINOR := `$(CXX) -dumpversion | cut -f2 -d.`
-       ifeq (1,$(shell expr \( $(GCC_MAJOR) \> 4 \) \| \( $(GCC_MAJOR) \= 4 \& $(GCC_MINOR) \>= 5 \)))
-               CXXFLAGS += -flto
-               LDFLAGS += $(CXXFLAGS)
+       ifeq ($(optimize),yes)
+               GCC_MAJOR := `$(CXX) -dumpversion | cut -f1 -d.`
+               GCC_MINOR := `$(CXX) -dumpversion | cut -f2 -d.`
+               ifeq (1,$(shell expr \( $(GCC_MAJOR) \> 4 \) \| \( $(GCC_MAJOR) \= 4 \& $(GCC_MINOR) \>= 5 \)))
+                       CXXFLAGS += -flto
+                       LDFLAGS += $(CXXFLAGS)
+               endif
        endif
 endif