@p2rkw and osdt:
Do either of you compile Code::Blocks yourself?
I am a C Programmer, who builds CB for myself on Windows 7 32-bit.
I have created a patch that I am doing the minimal level of testing for CB under Windows.
It will take a while, since my PC is really slow because I am compiling wxWidgets trunk right now.
I did only a tiny bit of testing on this patch it needs much more testing before I could recommend it be applied to CB trunk.
Edit: Updated patch to make it work more like the 12.11 version of CB; it now errors out when doing PCH "in directory along side header".
Edit2: Turns out 2 of the PCH methods do NOT work (in the same folder at the same time) since the PCH filename is the same as the PCH foldername; please remember to delete the PCH from one method before testing another in the same folder.
Index: src/sdk/projectfile.cpp
===================================================================
--- src/sdk/projectfile.cpp (revision 8942)
+++ src/sdk/projectfile.cpp (working copy)
@@ -186,9 +186,14 @@
if (compiler && compiler->GetSwitches().supportsPCH)
{
// PCHs are always using the extended name mode (at least for GCC)
- // the extension is set to "h.gch"
+ // the extension is set to "h.gch" for .h files.
if (project->GetModeForPCH() == pchSourceFile)
fname.Assign(relativeFilename);
+ if (fname.HasExt())
+ {
+ // Make the current file ext. part of the filename
+ fname.SetName(fname.GetName() + _T('.') + fname.GetExt());
+ }
fname.SetExt(compiler->GetSwitches().PCHExtension);
m_ObjName = fname.GetFullPath();
}
@@ -382,7 +387,7 @@
wxFileName fn(source_file_native);
object_file_native = fn.GetPath(wxPATH_GET_VOLUME | wxPATH_GET_SEPARATOR) +
- fn.GetName() + _T('.') + compiler->GetSwitches().PCHExtension +
+ fn.GetName() + _T('.') + fn.GetExt() + _T('.') + compiler->GetSwitches().PCHExtension +
wxFILE_SEP_PATH +
new_gch;
object_file_flat_native = object_file_native;
Index: src/sdk/compiler.cpp
===================================================================
--- src/sdk/compiler.cpp (revision 8942)
+++ src/sdk/compiler.cpp (working copy)
@@ -65,7 +65,7 @@
linkerNeedsLibExtension = false;
linkerNeedsPathResolved = false;
supportsPCH = true;
- PCHExtension = _T("h.gch");
+ PCHExtension = _T("gch");
UseFlatObjects = false;
UseFullSourcePaths = false;
Use83Paths = false;
Index: src/plugins/compilergcc/resources/compilers/options_gcc.xml
===================================================================
--- src/plugins/compilergcc/resources/compilers/options_gcc.xml (revision 8942)
+++ src/plugins/compilergcc/resources/compilers/options_gcc.xml (working copy)
@@ -35,7 +35,7 @@
<Switch name="linkerNeedsLibPrefix" value="false"/>
<Switch name="linkerNeedsLibExtension" value="false"/>
<Switch name="supportsPCH" value="true"/>
- <Switch name="PCHExtension" value="h.gch"/>
+ <Switch name="PCHExtension" value="gch"/>
<Switch name="UseFullSourcePaths" value="true"/>
<!-- Summary of GCC options: http://gcc.gnu.org/onlinedocs/gcc/Option-Summary.html -->
Index: src/plugins/compilergcc/resources/advanced_compiler_options.xrc
===================================================================
--- src/plugins/compilergcc/resources/advanced_compiler_options.xrc (revision 8942)
+++ src/plugins/compilergcc/resources/advanced_compiler_options.xrc (working copy)
@@ -599,7 +599,7 @@
</object>
<object class="sizeritem">
<object class="wxStaticText" name="ID_STATICTEXT35">
- <label>PCH extension (e.g. h.gch)</label>
+ <label>PCH extension (e.g. gch)</label>
</object>
<flag>wxTOP|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL</flag>
<border>4</border>
Tim S.