2 ms·
Unless they use pre compiled headers.
by giomasce 8y ago
Unless they use pre compiled headers.
- tlb 8y agoI've tried a few times to make PCH work reliably, but it's hard to get the Makefile right. My current project compiles both a regular executable and a Node.js module, which have different build processes. Is there an OS project with a reliable and portable PCH build process? Searching github didn't find me anything to copy from.
- monocasa 8y agopch is non portable at the moment.
- ecuzzillo 8y agoI just went through the process of making a reliable and portable PCH build process, and it's a lot of code to get right, because clang, gcc, and cl.exe all have quite different models for how a pch should work. cl.exe in particular has an insane set of requirements: - you can't compile the pch by itself, you have to have a cpp that #include's it and compile that; - then you have to link the resulting .obj file into the final binary; - if you use /Zi and you compile different versions of the pch for different headers, you have to have exactly one separate .pdb file for each compiled version of the pch; - if you have more, it will complain that some (pch, cpp) tuple do not share a .pdb; - if you have less, it will stochastically fail to open the global pdb file (because the pch writing process expects not to have contention for the pdb, even though it's using mspdbsrv and /FS for contention)