0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 10:12:39 +01:00

Activate PCH for position independent code.

Cuts compilation time by 30%+
This commit is contained in:
Jason Volk 2016-07-24 23:50:26 -07:00
parent 1eb7d4f319
commit 4796bec441
5 changed files with 20 additions and 1 deletions

View file

@ -5,6 +5,10 @@ AM_CPPFLAGS = \
$(LTDLINCL) \ $(LTDLINCL) \
@BOOST_CPPFLAGS@ @BOOST_CPPFLAGS@
if BUILD_PCH
AM_CPPFLAGS += -include $(top_srcdir)/include/rb/rb.pic.h
endif
AM_LDFLAGS = \ AM_LDFLAGS = \
-L$(top_srcdir)/ircd \ -L$(top_srcdir)/ircd \
-L$(top_srcdir)/rb \ -L$(top_srcdir)/rb \

View file

@ -1 +1,2 @@
config.h* config.h*
rb.pic.h

View file

@ -7,14 +7,20 @@ AM_CXXFLAGS = -fpch-deps
endif endif
if BUILD_PCH if BUILD_PCH
BUILT_SOURCES = rb.h.gch BUILT_SOURCES = rb.h.gch rb.pic.h.gch
endif endif
rb.h.gch: rb.h.gch:
$(CXX) $(CXXFLAGS) $(AM_CXXFLAGS) -o rb.h.gch $(DEFS) $(CPPFLAGS) $(AM_CPPFLAGS) rb.h $(CXX) $(CXXFLAGS) $(AM_CXXFLAGS) -o rb.h.gch $(DEFS) $(CPPFLAGS) $(AM_CPPFLAGS) rb.h
rb.pic.h.gch:
cp rb.h rb.pic.h
$(CXX) $(CXXFLAGS) $(AM_CXXFLAGS) -fPIC -o rb.pic.h.gch $(DEFS) $(CPPFLAGS) $(AM_CPPFLAGS) rb.pic.h
clean-local: clean-local:
rm -f rb.h.gch rm -f rb.h.gch
rm -f rb.pic.h
rm -f rb.pic.h.gch
mrproper-local: mrproper-local:
rm -f config.h rm -f config.h

View file

@ -11,6 +11,10 @@ AM_CPPFLAGS = \
@LTDLINCL@ \ @LTDLINCL@ \
@BOOST_CPPFLAGS@ @BOOST_CPPFLAGS@
if BUILD_PCH
AM_CPPFLAGS += -include $(top_srcdir)/include/rb/rb.pic.h
endif
if MINGW if MINGW
PLATFORM_LDFLAGS = -Wl,--enable-runtime-pseudo-reloc -export-symbols-regex '*' PLATFORM_LDFLAGS = -Wl,--enable-runtime-pseudo-reloc -export-symbols-regex '*'
endif endif

View file

@ -6,6 +6,10 @@ AM_CPPFLAGS = \
$(LTDLINCL) \ $(LTDLINCL) \
@BOOST_CPPFLAGS@ @BOOST_CPPFLAGS@
if BUILD_PCH
AM_CPPFLAGS += -include $(top_srcdir)/include/rb/rb.pic.h
endif
AM_LDFLAGS = \ AM_LDFLAGS = \
-L$(top_srcdir)/ircd \ -L$(top_srcdir)/ircd \
-L$(top_srcdir)/rb \ -L$(top_srcdir)/rb \