Skip to content

Commit

Permalink
Enable experimental support for link-time optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
ecsv committed Jun 8, 2012
1 parent 5642c1f commit ea88498
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions projects/unix/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ targets:
@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)
Expand All @@ -335,6 +336,11 @@ CFLAGS += -MD
-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
Expand Down

0 comments on commit ea88498

Please sign in to comment.