What is _PreComp_???

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
gneiss
Posts: 75
Joined: Tue Mar 05, 2019 4:13 pm

Re: What is _PreComp_???

Post by gneiss »

Thank's for the link, unfortunately that doesn't describe how/if that will use PCH with gcc..
I don't see how the compiler used is defined (kike inside a Makefle with cc = ...).
So did that mean, that it will only work if the used copier supports "generating separate PCH files". So, not working with gcc ?
wmayer
Founder
Posts: 20242
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: What is _PreComp_???

Post by wmayer »

unfortunately that doesn't describe how/if that will use PCH with gcc
One has to check the CMake source code to see how it's done. But I am pretty sure it doesn't use the #pragma hdrstop but the -x compiler switch:
https://gcc.gnu.org/onlinedocs/gcc/Prec ... ed-Headers
gneiss
Posts: 75
Joined: Tue Mar 05, 2019 4:13 pm

Re: What is _PreComp_???

Post by gneiss »

Ah, Yes, that makes sense...
And it seams that this way is a better/moderner way of using PCH.
It didn't need any modification of the source to use PCH, just some settings in the (C-)Makefile.
Maybe I missed this, because I mostly wrote "bare metal" software for microprocessors using a cross compiler mostly based on gcc and these compilers doesn't support that kind of PCH.
Thanks for the explanation.
Post Reply