Use PCH

Bug #723667 reported by Olaf van der Spek
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Drizzle
Confirmed
Wishlist
Unassigned

Bug Description

To decrease build times, A PCH should be used. A PCH (pch.h.gch) can be build with "g++ pch.h". Since I've no experience with the build system, could someone help me to add this bit?
A depedency on pch.h.gch should also be added to config.h.

http://gcc.gnu.org/onlinedocs/gcc/Precompiled-Headers.html

Changed in drizzle:
importance: Undecided → Wishlist
status: New → Confirmed
milestone: none → future
Revision history for this message
Olaf van der Spek (olafvdspek) wrote :

In a Hello World app, this suffices:
BUILT_SOURCES = config.h.gch

config.h.gch: config.h
 ${CXXCOMPILE} -o $@ $<

But in Drizzle this doesn't work.
It seems the GCC invocations don't match and the PCH is ignored.

PCH compile:
g++ -DHAVE_CONFIG_H -I. -I. -g -pipe -std=gnu++98 -O2 -fvisibility=hidden -fvisibility-inlines-hidden -Werror -pedantic -Wall -Wundef -Wshadow -fdiagnostics-show-option -floop-parallelize-all -fno-strict-aliasing -Wno-strict-aliasing -Wextra -Wformat -Wno-format-nonliteral -Wno-format-security -Woverloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy -Wno-long-long -Wmissing-declarations -Wframe-larger-than=32768 -Wno-redundant-decls -c config.h

Normal compile:
  CXX drizzled/message/drizzled_message_libdrizzledmessage_la-statement_transform.lo

Monty, could you look into this?

BTW, why does it use .lo instead of .o?

Revision history for this message
Monty Taylor (mordred) wrote :

In reverse order:

.lo is a libtool object description file, and it's used because we use libtool. Libtool then uses these at link time to help build the libraries. (you'll also note that .la files are the in-tree libraries - which allow things be able to be used in-tree and then things get re-linked at install time so that all of the rpath info is correct)

That being said - you need to use LTCXXCOMPILE instead of CXXCOMPILE

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.