Author Topic: Precompiled headers (PCH) support in Code::Blocks  (Read 42747 times)

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Precompiled headers (PCH) support in Code::Blocks
« Reply #30 on: October 22, 2005, 10:45:16 am »
@Yiannis

i just updated some of my private projects to use CB's PCH-support and would like to know,
if there is some proposed way till now, to change the compiling sequence.

* all my projects where i have added PCH support, have the relevant header file precomp.h as last file in the project list

* when i do a Rebuild, all source files get compiled without PCH and at last the header precomp.h get's precompiled to precomp.h.gch :?

* i changed the "Priority Weight" Slider of the precomp.h to 100%, but it didn't change anything

* as last resort i edited the project file and put the precomp.h at the first position of project files,  8)
 but it didn't change anything

? is it somehow possible to create the .gch file BEFORE the source modules are compiled when i use Rebuild Project ?

thanks

Offline Urxae

  • Regular
  • ***
  • Posts: 376
Re: Precompiled headers (PCH) support in Code::Blocks
« Reply #31 on: October 22, 2005, 11:05:30 am »
3.) i manually compiled the wxsheaders.h to wxsheaders.h.gch
because the wxSmith_2_6.cbp project file has not marked the wxsheaders.h to use it pre-compiled.

Why not just mark them as precompiled yourself? (and adjust priorities, see below)

Quote
(nice feature which Yiannis added into one of the very last CB commits, thanks to Yiannis btw. !!)
[...]
really nice !
I agree :)

@Yiannis

Not me, but I'll answer anyway ;)

Quote
* when i do a Rebuild, all source files get compiled without PCH and at last the header precomp.h get's precompiled to precomp.h.gch :?

* i changed the "Priority Weight" Slider of the precomp.h to 100%, but it didn't change anything

* as last resort i edited the project file and put the precomp.h at the first position of project files,  8)
 but it didn't change anything

? is it somehow possible to create the .gch file BEFORE the source modules are compiled when i use Rebuild Project ?

You should set the "Priority Weight" slider to 0% (or anything below the other source files at least). This one had me confused also, but basically it works the other way around than you'd expect :shock:. Lower priority weight means compiled earlier.
If you have multiple precompiled headers, and one uses the other, make sure the used one's priority weight is lower than the using one.

But this is indeed a very cool feature 8). Thanks, Yiannis.

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Precompiled headers (PCH) support in Code::Blocks
« Reply #32 on: October 22, 2005, 11:12:28 am »
...You should set the "Priority Weight" slider to 0% (or anything below the other source files at least). This one had me confused also, but basically it works the other way around than you'd expect :shock:. Lower priority weight means compiled earlier....
thanks Urxae for enlightening me !! it works as you told , even when i never expected it working this way ... ( i have to improve my logic  :? isn't it ?)

But this is indeed a very cool feature 8). Thanks, Yiannis.
indeed it is, again, thanks too !

as i know CB is the second IDE which is able to use GCC's PCH features
(the first one was Chinook, from where i looked how it works)

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Precompiled headers (PCH) support in Code::Blocks
« Reply #33 on: October 22, 2005, 11:17:15 am »
3.) i manually compiled the wxsheaders.h to wxsheaders.h.gch
because the wxSmith_2_6.cbp project file has not marked the wxsheaders.h to use it pre-compiled.
Why not just mark them as precompiled yourself? (and adjust priorities, see below)
yes i did it that way, thanks again !

I only wanted to post my comment about, that the project file in CVS could be optimised for that specific feature too  :)

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Precompiled headers (PCH) support in Code::Blocks
« Reply #34 on: October 22, 2005, 11:40:17 am »
* i changed the "Priority Weight" Slider of the precomp.h to 100%, but it didn't change anything

As pointed out by Urxae, priority should be less than the default (50). Possibly 0 to ensure that it's compiled first.
Is it actually displaying the percent (%) sign? Because that would be wrong. Priority is a number ranging from 0 to 100, with lowest number meaning higher priority...
Be patient!
This bug will be fixed soon...

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Precompiled headers (PCH) support in Code::Blocks
« Reply #35 on: October 22, 2005, 11:47:10 am »
...Is it actually displaying the percent (%) sign?
no %  sign there ! everything is OK  :D

Priority is a number ranging from 0 to 100, with lowest number meaning higher priority...
somehow i intuitively thought - higher number - higher priority - but this is obviously too simple  8)
i understand now  :o , and it works as intended  8)


thanks to all for your rapid help, tips & tricks !
« Last Edit: October 22, 2005, 11:48:48 am by tiwag »

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Precompiled headers (PCH) support in Code::Blocks
« Reply #36 on: October 22, 2005, 11:47:26 am »
I added an explanation string regarding the priority setting, in the file properties dialog.
Be patient!
This bug will be fixed soon...

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Precompiled headers (PCH) support in Code::Blocks
« Reply #37 on: October 22, 2005, 11:54:10 am »
I added an explanation string regarding the priority setting, in the file properties dialog.
there is another bug in this dialog
the scale title shows here by me : "  0          0        100 "     instead of      " 0       50      100 "

edit:
i understand, the middle number is the actual set value.
i'm somewhat over-worked and tired today - sorry for my lot of stupid questions which i was posting today -
« Last Edit: October 22, 2005, 11:57:25 am by tiwag »

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Precompiled headers (PCH) support in Code::Blocks
« Reply #38 on: October 22, 2005, 11:55:50 am »
I added an explanation string regarding the priority setting, in the file properties dialog.
there is another bug in this dialog
the scale title shows here by me : "  0          0        100 "     instead of      " 0       50      100 "

This appearence is windows-only so I can't verify it now. But from what I remember, the middle number is the actual setting so if you move the slider it will change too...
Be patient!
This bug will be fixed soon...

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Precompiled headers (PCH) support in Code::Blocks
« Reply #39 on: October 22, 2005, 12:05:54 pm »
... from what I remember, the middle number is the actual setting so if you move the slider it will change too...

maybe it would be a lot clearer, if the dialog would show
Code
" Priority:    high                    xx                 low  "
"                 |   |   |   |   |   |   |   |   |   |   |    "
and xx displays the number from 0 ... 100 according to the actual setting of the slider


edit:
btw Yiannis - which tool are you using for editing the xrc dialogs ?