Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Precompiled headers (PCH) support in Code::Blocks

<< < (3/8) > >>

mandrav:

--- Quote ---No it won't work for all, but there is a good reason why I suggested that. Most compilers don't need precompiled headers, to be honest. It is mostly gcc that turns from "painful" to "hey, quite ok".
--- End quote ---

Well, I 'll have to disagree a little with you here. I work with MSVC Toolkit for some of my projects and I can tell you that without PCH, MS's compiler is much slower than it's perceived to be than when using it...
I don't have actual timings to show, but let's just say that I wasn't dazzled by the speed difference between gcc and MSVC toolkit (both without PCH).


--- Quote ---And here's the gotcha... changing options disables the precompiled header.  (Edit: not all options do, but many, and it is not a trivial matter which do)
This is why I think this should absolutely be automated somehow, else there will be a lot of grief sooner or later - not everybody is aware of this. People will run the batch file and change options the other day, and will wonder why it suddenly takes an hour to build.
--- End quote ---

Not exactly...
Inside the PCH, all of the includes are guarded by CB_PRECOMP. If this isn't defined then it's like you didn't include the PCH file in the first place.
Your "-include" trick would need a rebuild to switch from using-PCH to not-using-PCH. So does the implemented solution.

The big advantage of the way it's done now, is that the PCH compilation is part of the project compilation, meaning it's definetely using the correct compiler flags (assuming you 've set it up properly).


--- Quote ---I'd advise to at least take some kind if command-line switch to turn using the precompiled header on/off. Maybe just put a big #ifdef CB_PRECOMP around the contents of the precompile #includes (if you haven't done this already that is).
--- End quote ---

Actually, CB_PRECOMP is used :)

rickg22:
Does it work for linux builds, too? If it does, then we're all set for RC2! :D

mandrav:

--- Quote from: rickg22 on October 19, 2005, 05:42:37 pm ---Does it work for linux builds, too? If it does, then we're all set for RC2! :D

--- End quote ---

Not yet. I 'm looking for ways to add it (btw, does anyone know how to add pch support in autotools?).

And Rick, we 're not set for RC2. After your changes in threadpool, my C::B deadlocks quite often (0% CPU - a mutex lock). I 'm not sure it's this, but I started having these freezes right after that change. I 'm looking into it...

tiwag:
well done Yiannis !!
i haven't had the heart to propose such because the much work you've done now...

mandrav:

--- Quote from: tiwag on October 19, 2005, 06:33:15 pm ---well done Yiannis !!
i haven't had the heart to propose such because the much work you've done now...

--- End quote ---

Thanks for motivating me (again), with your referenced post :)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version