Use precompiled headers
Closed this issue · 3 comments
It would be nice to use precompiled headers to improve build times:
http://www.wxwidgets.org/develop/standard.htm#pch
http://wiki.wxwidgets.org/Precompiled_Headers
Though it looks like there is no support for mac. So not sure how we handle that...
Update:
If you're using xcode you just set GCC_PRECOMPILE_PREFIX_HEADER = YES
and
GCC_PREFIX_HEADER = wxWidgets/include/wx/wxprec.h
(I haven't used make with
wxWidgets on Mac in a long time so I'm not sure about precompiled headers
without xcode...)
Update 2:
Interestingly enough, here's what the header says:
// check if to use precompiled headers: do it for most Windows compilers unless
// explicitly disabled by defining NOPCH
if defined(VISUALC) || \
defined(__DMC__) || \
defined(__VISAGECPP__) || \
defined(__WATCOMC__) || \
defined(__BORLANDC__)
// If user did not request NOCPH and we're not building using configure
// then assume user wants precompiled headers.
#if !defined(NOPCH) && !defined(__WX_SETUP_H__)
#define WX_PRECOMP
#endif
endif
conspicuously Missing: OSX…
Guess I've been drinking the coolaid too long...
-Richard
Update 3:
Ah... no, it looks like wxWidgets does this differently for gcc/clang.
WX_PRECOMP
is defined in the gcc command line options either by configure
or the xcode project. It looks like they now include the .xcconfig
files in
the samples xcode projects so that's another way of getting all this
right. Then it should just be automatic. Precompiled headers in Visual
Studio is more of pain.
This is fixed in 3.3.4 for Mac. I changed the project settings and added a define. That looked simple enough.
Issue still there for Windows builds. Recommend keeping this open.
Sounds good. I'll tag it as Windows specific.
Addressed in #127