I guess I miss a lot of things, but in particular, Microsoft managed to sneak the /YX switch into the compiler without my noticing. Wow! I could never decide if I hated the absymally slow C++ compile times I was getting for our products or the Hell Of Pre-Compiled Header Setup And Maintenance (to quote
Big Trouble In Little China, I have a lot of hells…). This newfangled /YX thingy figures out where the headers stop automatically and builds PCH files all by itself, and then next time it finds them and uses them! I’m sure that this is common knowledge, but automatic PCH generation is about the Best Thing Ever (apologies to whatevs).
Then again,
Johnny Cash’s American IV, now playing, is a close #2.
/YX is flawed. Don’t use it.
Every single project I’ve created or that I’ve seen which uses it ends up rebuilding the PCH on every single compile. You might as well not be using PCH at all.
Setting up manual PCH takes a second or two and as an added bonus, it actually works correctly too!
Looks great to me – I tried it out on a few small projects and it looked like it worked. Any idea why it would just decide to not work? Anyway, I still say that keeping pch working is a pain, for any reasonable-sized, multi-developer project.
This does, of course, ignore the much more fundamental header organization principles that should be used regardless of pch.
w9woOd