Author Topic: Enable the PCH when build C::B against wx3.x  (Read 11934 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5624
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Enable the PCH when build C::B against wx3.x
« Reply #15 on: February 13, 2022, 09:27:59 am »
Enabling PCH does reduce the build time, both in 32bit and 64bit mingw gcc compiler.

Maybe, we can set an command line option that someone can use PCH, and someone can disable PCH.  :)

I was asking about GCC version as checking as it looked like GCC < 7 may crash if the PCH is too big and as such I though it may be a good idea to update the GCC version in the check to only enable PCH in GCC >=7.

In the long run wouldn't it be better to get PCH working correctly in order to speed up the C::B build so devs can do more coding than wait for build to complete?


I'm OK with this check. I see your have some patches about the configure/make under msys2, but I'm not familiar with the auto-tool system, hope other devs can review your changes.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline AndrewCot

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 649
Re: Enable the PCH when build C::B against wx3.x
« Reply #16 on: February 13, 2022, 09:59:20 am »
Building via a command line using bootstrap/configure/make can be done. But using C::B to build itself does not allow you to conditionally build with or without PCH at the moment.
I have working change where you can specify a global variable set to use in the C::B batch build and you could use this to change variables so that one set has the PCH options in the variable and the other set has "".  The other option is to use two different config sets and then you have to keep two sets in sync, which is a pain....
Enabling PCH does reduce the build time, both in 32bit and 64bit mingw gcc compiler.

Maybe, we can set an command line option that someone can use PCH, and someone can disable PCH.  :)

I was asking about GCC version as checking as it looked like GCC < 7 may crash if the PCH is too big and as such I though it may be a good idea to update the GCC version in the check to only enable PCH in GCC >=7.

In the long run wouldn't it be better to get PCH working correctly in order to speed up the C::B build so devs can do more coding than wait for build to complete?

I'm OK with this check. I see your have some patches about the configure/make under msys2, but I'm not familiar with the auto-tool system, hope other devs can review your changes.
100% agree and I have been working on more changes to the patches. I am setting up a github repo branch for people to test with instead of having to apply the patches that will include some bash scripts that will save people time and effort in the building and cleaning step.  Should hopefully have the repo ready tonight or tomorrow.