Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
patch to build C::B against wx 3.0 with PCH enabled
stahta01:
I prefer <sdk.h> instead of "sdk.h" for CB Plugins (for the src/src folder I have not decided which I prefer); years ago it was about 50 percent of each. But, I always been fixing my patches to <sdk.h>.
Edit: After more work with PCH I now think "sdk.h" is more correct; since all PCH files are local to the project under Windows MinGW GCC.
The wxContrib changes the build objects NOT the PCH; but, it really speeds it up.
1. wxContrib uses neither <sdk.h> or "sdk.h"; it does uses wxprec.h/wx.h
2. It was being built wrong under Windows it used the "building wxwidgets" DLL macro instead of the "using wxWidgets" DLL macro.
This results in many more symbols exported and my guess it increases both compile and link times.
I fixed the easy targets to use "using wxWidgets" DLL macro; it resulted in faster build times.
"Why there is no -iquote?"
My guess in the CB code is the -iquote is added when the project builds a precompiled header.
But, only the CB core project builds a PCH.
Both the "FileManager and ToolsPlus Plugin" are written poorly from the view point of using the PCH sdk.h
Note: This is true of most of the contrib plugins; I am willing to try to fix them one at a time; but, do NOT have the time or ability to test the plugins.
Note2: A simple test to see if the plugin is written right to use the sdk.h PCH is to remove the defines of WX_PRECOMP and CB_PRECOMP; and, add one of NOPCH. If the build time decreases than it is likely NOT well written to use sdk.h PCH. Please compare the time to the time of using the PCH with the obj folder first in the search list.
If you wish; try the ToolsPlus Plugin and see if you get any improvements my PC is very poor on testing speed improvement.
Its just too random in results. Just have Firefox open results in slower times on my PC.
I just finished a patch for ToolsPlus Plugin to use sdk.h right in my view.
But, I have to verify with the Plugin owner to verify the 3 or 4 files that says do NOT edit are safe to edit.
Tim S.
stahta01:
FYI:
I found a quick way too see if Contrib Plugins would be improved by adding PCH headers like sdk.h to them.
Found out about it on gcc help page on gch/PCH stuff. http://gcc.gnu.org/onlinedocs/gcc/Precompiled-Headers.html
Edit: Changed devpak_plugin from 25 seconds to 16 seconds for me to build.
NOTE: If the CB Project includes the PCH file inside source folders it errors out.
So, only good to check projects NOT including sdk.h
Tim S.
--- Code: ---Index: src/plugins/contrib/devpak_plugin/DevPakPlugin.cbp
===================================================================
--- src/plugins/contrib/devpak_plugin/DevPakPlugin.cbp (revision 9602)
+++ src/plugins/contrib/devpak_plugin/DevPakPlugin.cbp (working copy)
@@ -42,6 +42,8 @@
<Add option="-DWXUSINGDLL" />
<Add option="-DcbDEBUG" />
<Add option="-DwxUSE_UNICODE" />
+ <Add option="-include sdk.h" />
+ <Add directory="..\..\..\.objs\include" />
<Add directory="..\..\..\include" />
</Compiler>
<Linker>
--- End code ---
stahta01:
--- Quote from: ollydbg on January 20, 2014, 08:03:28 am ---Hope someone think it is useful.
I build CodeBlocks_wx30.cbp with GCC 4.7.x from MinGW-Build. It should be faster than the default NON-PCH build.
NOTE: GCC 4.8.x should be avoid if you want to build C::B with PCH enabled under Windows.
--- End quote ---
I just realized that adding WX_PRECOMP back is NOT needed and I think it should NOT be done.
If you wish to continue adding back PCH to wx30 projects; please try it without adding WX_PRECOMP.
Tim S.
ollydbg:
--- Quote from: stahta01 on January 27, 2014, 03:19:50 pm ---
--- Quote from: ollydbg on January 20, 2014, 08:03:28 am ---Hope someone think it is useful.
I build CodeBlocks_wx30.cbp with GCC 4.7.x from MinGW-Build. It should be faster than the default NON-PCH build.
NOTE: GCC 4.8.x should be avoid if you want to build C::B with PCH enabled under Windows.
--- End quote ---
I just realized that adding WX_PRECOMP back is NOT needed and I think it should NOT be done.
If you wish to continue adding back PCH to wx30 projects; please try it without adding WX_PRECOMP.
Tim S.
--- End quote ---
Hi, Tim, I get confused, why "WX_PRECOMP" is not needed here? Can you explain it a little?
stahta01:
--- Quote from: ollydbg on January 27, 2014, 03:26:47 pm ---
--- Quote from: stahta01 on January 27, 2014, 03:19:50 pm ---
--- Quote from: ollydbg on January 20, 2014, 08:03:28 am ---Hope someone think it is useful.
I build CodeBlocks_wx30.cbp with GCC 4.7.x from MinGW-Build. It should be faster than the default NON-PCH build.
NOTE: GCC 4.8.x should be avoid if you want to build C::B with PCH enabled under Windows.
--- End quote ---
I just realized that adding WX_PRECOMP back is NOT needed and I think it should NOT be done.
If you wish to continue adding back PCH to wx30 projects; please try it without adding WX_PRECOMP.
Tim S.
--- End quote ---
Hi, Tim, I get confused, why "WX_PRECOMP" is not needed here? Can you explain it a little?
--- End quote ---
1. Under MinGW GCC you can only have a single PCH file in a compilation unit; The CB_PRECOMP is correct for using a PCH of sdk.h
2. Currently, inside sdk_common.h the WX_PRECOMP is set if CB_PRECOMP is set without NOPCH being set.
(This is the correct way to have the sdk.h PCH include what an wxprec.h PCH file would.)
3. The setting of WX_PRECOMP to true implies the use of wxprec.h; this is NOT true for some (hopefully nearly all) CB Projects.
4. The using of wxprec.h (with WX_PRECOMP true) when it is NOT a PCH file slows down the build process.
FYI: In MinGW GCC, it appears that only the first header file included can be a PCH and have the include use a PCH.
Also, including a PCH file inside another header file DOES NOT use the PCH file.
Tim S.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version