Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Modified & Improved wxWidgets Project Wizard
TDragon:
--- Quote from: Biplab on January 03, 2007, 02:20:45 pm ---Any suggestions on what went wrong?
--- End quote ---
As mandrav said, he "hard-coded" support for GCC precompiled headers. In effect, this means that any header that is marked to be compiled will follow whichever rule you choose in the Precompiled headers section of your project properties: generate the pch alongside the original header, in a subdirectory of the original header's directory, or in the object output directory (this last option introduces the "-I-" (I-split) switch, which can cause issues with other includes, particularly from external libraries).
mandrav:
--- Quote from: TDragon on January 03, 2007, 03:30:49 pm ---
--- Quote from: Biplab on January 03, 2007, 02:20:45 pm ---Any suggestions on what went wrong?
--- End quote ---
As mandrav said, he "hard-coded" support for GCC precompiled headers. In effect, this means that any header that is marked to be compiled will follow whichever rule you choose in the Precompiled headers section of your project properties: generate the pch alongside the original header, in a subdirectory of the original header's directory, or in the object output directory (this last option introduces the "-I-" (I-split) switch, which can cause issues with other includes, particularly from external libraries).
--- End quote ---
And you can change this behaviour with your wizard by using the SetModeForPCH() function of cbProject...
Biplab:
--- Quote from: mandrav on January 03, 2007, 03:53:37 pm ---
--- Quote from: TDragon on January 03, 2007, 03:30:49 pm ---
--- Quote from: Biplab on January 03, 2007, 02:20:45 pm ---Any suggestions on what went wrong?
--- End quote ---
As mandrav said, he "hard-coded" support for GCC precompiled headers. In effect, this means that any header that is marked to be compiled will follow whichever rule you choose in the Precompiled headers section of your project properties: generate the pch alongside the original header, in a subdirectory of the original header's directory, or in the object output directory (this last option introduces the "-I-" (I-split) switch, which can cause issues with other includes, particularly from external libraries).
--- End quote ---
And you can change this behaviour with your wizard by using the SetModeForPCH() function of cbProject...
--- End quote ---
I had changed it to SetModeForPCH(pchObjectDir) Though it was creating GCH file in obj directory, but it was not used during compilation. I'm quoting the results.
* Process terminated with status 0 (0 minutes, 8 seconds) - Clean Recompile of sample app Without PCH with GCC
* Process terminated with status 0 (0 minutes, 1 seconds) - Clean Recompile of sample app With PCH with GCC(SetModeForPCH(pchSourceDir) option is set in wizard) after GCH file is fully written
* Process terminated with status 0 (0 minutes, 8 seconds) - Clean Recompile of sample app With PCH with GCC (SetModeForPCH(pchObjectDir) option is set in wizard) after GCH file is fully written
It is obvious that SetModeForPCH(pchObjectDir) is not working properly. Then I tried to add -I flag to point that the GCH file is in obj dir. But it didn't work, possibly as the PCH compilation is hardcoded.
Setting SetModeForPCH(pchObjectDir) will fix a bug present in the old wizard where if you are compiling app in two targets, one after another, you'll be thrown an warning (which may stop the build) saying that the GCH file is compiled with different flag. As GCC uses the first GCH file found in file.h.gch folder, this problem arises.
mandrav:
--- Quote ---As GCC uses the first GCH file found in file.h.gch folder, this problem arises.
--- End quote ---
Another misconception here. GCC will use the gch that matches the running build. It just emits a warning for those gch that it ignores (you can avoid this warning by not defining the -Winvalid-pch option).
Biplab:
--- Quote from: mandrav on January 03, 2007, 05:26:14 pm ---
--- Quote ---As GCC uses the first GCH file found in file.h.gch folder, this problem arises.
--- End quote ---
Another misconception here. GCC will use the gch that matches the running build. It just emits a warning for those gch that it ignores (you can avoid this warning by not defining the -Winvalid-pch option).
--- End quote ---
Thanks for clearing the misconception. :D
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version