Patches to improve the compile time for wxContribItems.
NOTE: I have NOT tested the Binaries produced by wxContribItems project.
NOTE: I still need to test src/include/wxprec.h under wxWidgets 3.0. Removed the PCH building Stuff.
Adds target cleanPCH.
Adds a modified wxprec.h file needed to create the wxWidgets PCH file.Any suggestions on another way to create the wxWidgets PCH file?
Re-did; removed the wxWidgets PCH stuff; the speedup seems NOT to be worth doing.
Index: src/CodeBlocks.cbp
===================================================================
--- src/CodeBlocks.cbp (revision 9434)
+++ src/CodeBlocks.cbp (working copy)
@@ -709,6 +709,15 @@
<Mode after="always" />
</ExtraCommands>
</Target>
+ <Target title="cleanPCH">
+ <Option type="4" />
+ <Option compiler="gcc" />
+ <ExtraCommands>
+ <Add after="cmd /c if exist .objs\include\sdk_precomp.h.gch del .objs\include\sdk_precomp.h.gch" />
+ <Add after="cmd /c if exist .objs\include\sdk.h.gch del .objs\include\sdk.h.gch" />
+ <Mode after="always" />
+ </ExtraCommands>
+ </Target>
<Environment>
<Variable name="WX_CFG" value="" />
<Variable name="WX_SUFFIX" value="u" />
Index: src/CodeBlocks_wx30.cbp
===================================================================
--- src/CodeBlocks_wx30.cbp (revision 9435)
+++ src/CodeBlocks_wx30.cbp (working copy)
@@ -710,6 +710,15 @@
<Mode after="always" />
</ExtraCommands>
</Target>
+ <Target title="cleanPCH">
+ <Option type="4" />
+ <Option compiler="gcc" />
+ <ExtraCommands>
+ <Add after="cmd /c if exist .objs30\include\sdk_precomp.h.gch del .objs30\include\sdk_precomp.h.gch" />
+ <Add after="cmd /c if exist .objs30\include\sdk.h.gch del .objs30\include\sdk.h.gch" />
+ <Mode after="always" />
+ </ExtraCommands>
+ </Target>
<Environment>
<Variable name="WX_CFG" value="" />
<Variable name="WX_SUFFIX" value="u" />
Modifies the wxContribItems project to use the PCH wxprec.h from prior patch.(The PCH use Modification requires changing WXMAKINGDLL to WXUSINGDLL)
NOTE: The Binary objects are much smaller after applying this patch; it may have the side effect of reducing the symbols exported from wxWidgets headers.
NOTE: The targets KWIC and wxTreeList do NOT use the PCH header because they have no support for doing so in the code.
FYI: The KWIC has some support added at the wxCode site.
Edit: Based on more in-depth code review these targets are NOT currently safe to do the PCH use mod.
wxImagePanel
wxKwic Note: The upstream code looks link it will support changing WXMAKINGDLL to WXUSINGDLL
wxSpeedButton
wxTreeList
Re-did Patch removed the PCH search folder; still needs more testing; changing WXMAKINGDLL to WXUSINGDLL was nearly all the compile speedup.
Index: src/plugins/contrib/wxContribItems/wxContribItems.cbp
===================================================================
--- src/plugins/contrib/wxContribItems/wxContribItems.cbp (revision 9436)
+++ src/plugins/contrib/wxContribItems/wxContribItems.cbp (working copy)
@@ -16,6 +16,7 @@
<Option createStaticLib="1" />
<Compiler>
<Add option="-DWXMAKINGDLL_FNB" />
+ <Add option="-DWXUSINGDLL" />
<Add directory="wxFlatNotebook/include" />
</Compiler>
</Target>
@@ -28,6 +29,7 @@
<Option createStaticLib="1" />
<Compiler>
<Add option="-DWXMAKINGDLL_CHART" />
+ <Add option="-DWXUSINGDLL" />
<Add directory="wxchart/include" />
</Compiler>
</Target>
@@ -40,6 +42,7 @@
<Option createStaticLib="1" />
<Compiler>
<Add option="-DWXMAKINGDLL_THINGS" />
+ <Add option="-DWXUSINGDLL" />
<Add directory="wxthings/include" />
</Compiler>
</Target>
@@ -51,6 +54,7 @@
<Option compiler="gcc" />
<Option createStaticLib="1" />
<Compiler>
+ <Add option="-DWXMAKINGDLL" />
<Add directory="wxImagePanel/include" />
</Compiler>
<Linker>
@@ -64,6 +68,9 @@
<Option type="3" />
<Option compiler="gcc" />
<Option createStaticLib="1" />
+ <Compiler>
+ <Add option="-DWXMAKINGDLL" />
+ </Compiler>
<Linker>
<Add option="-Wl,--export-all-symbols" />
</Linker>
@@ -76,6 +83,7 @@
<Option compiler="gcc" />
<Option createStaticLib="1" />
<Compiler>
+ <Add option="-DWXMAKINGDLL" />
<Add directory="KWIC/include" />
</Compiler>
<Linker>
@@ -90,6 +98,7 @@
<Option compiler="gcc" />
<Option createStaticLib="1" />
<Compiler>
+ <Add option="-DWXMAKINGDLL" />
<Add directory="wxTreeList/include" />
</Compiler>
</Target>
@@ -101,6 +110,8 @@
<Option compiler="gcc" />
<Option createStaticLib="1" />
<Compiler>
+ <Add option="-DWXMAKINGDLL_GIZMOS" />
+ <Add option="-DWXUSINGDLL" />
<Add directory="wxled/ledpanel/include" />
<Add directory="wxled/lcdWindow/include" />
<Add directory="wxled/led/include" />
@@ -127,7 +138,6 @@
<Add option="-Winvalid-pch" />
<Add option="-DHAVE_W32API_H" />
<Add option="-D__WXMSW__" />
- <Add option="-DWXMAKINGDLL" />
<Add option="-DwxUSE_UNICODE" />
<Add directory="$(#wx.include)" />
<Add directory="$(#wx.lib)/gcc_dll$(WX_CFG)/msw$(WX_SUFFIX)" />
Tim S.