[cmake-developers] RFC: CMake precompiled header support and custom compiler based implementation

Amine Khaldi amine.khaldi at reactos.org
Fri Mar 20 14:51:02 EDT 2015


> My solution needs to generate additional target indeed for one pre-generated header, so if all your 1000+ targets will share same precompiled header (given the compiler flags don't change) then you will have just one (single) additional target.

It's very rare (not to mention risky) to be able to share a PCH with more than one target, because each target can have its own set of defines/flags and header inclusions, so we'd really end up with additional 1000+ targets.

BTW, please note that the most recent test is still https://github.com/nanoant/CMakePCHCompiler/issues/1#issuecomment-77003296

> If CMake will support PCH natively I don't see any reason it will need extra target, yet obviously there will be extra (Ninja) compiler rule for PCH.
That's far better than extra targets.


More information about the cmake-developers mailing list