Commits

ecsv committed 28a2ec2

Enable experimental support for link-time optimization

  • Participants
  • Parent commits a1c35b7
  • Tags 1.99.5

Comments (0)

Files changed (1)

File projects/unix/Makefile

 	@echo "    DESTDIR=path  == path to prepend to all installation paths (only for packagers)"
 	@echo "  Debugging Options:"
 	@echo "    DEBUG=1       == add debugging symbols"
+	@echo "    LTO=1         == enable experimental build with link-time optimization"
 	@echo "    V=1           == show verbose compiler output"
 
 all: $(TARGET)
 -include $(OBJECTS:.o=.d)
 
 CXXFLAGS += $(CFLAGS)
+ifeq ($(LTO), 1)
+  CFLAGS += -flto
+  CXXFLAGS += -flto
+  LDFLAGS += -fuse-linker-plugin $(CXXFLAGS)
+endif
 
 # standard build rules
 $(OBJDIR)/%.o: $(SRCDIR)/%.c