Browse Source

Enable Link Time Optimization only if the compiler is gcc because clang

needs ld.gold which is not neccessary available.
tags/v1.1
Bernhard Fröhlich 4 years ago
parent
commit
a3de3bd454
1 changed files with 6 additions and 0 deletions
  1. 6
    0
      Makefile

+ 6
- 0
Makefile View File

@@ -26,6 +26,12 @@ LDFLAGS	+= -pg
26 26
 else
27 27
 # for release
28 28
 CFLAGS	+= -Ofast
29
+
30
+# enable LTO for gcc
31
+ifeq ($(shell $(CC) --version | grep gcc >/dev/null; echo $$?),0)
32
+CFLAGS	+= -flto
33
+LDFLAGS	+= -flto
34
+endif
29 35
 endif
30 36
 
31 37
 # we need to link to libc/msvcrt

Loading…
Cancel
Save