title: Using /YC and /MP together in a Visual Studio 10 project
body: <p>I'm trying to get around the limitation of /YC and /MP being mutually exclusive. I'd like to leverage precompiled headers AND multi-process compilation.</p>
  
  <p>My answer so far has been to create 2 projects instead of 1. The first is a pch generating library consisting of just an stdafx.h and stdafx.cpp. It generates the pch file with /YC set on the stdafx.cpp</p>
  
  <p>That library generates the pch file successfully! As a side note, the pch library project also has /YU specified pointing to its stdafx.h and /Fp referencing the output pch file.</p>
  
  <p>My second project is my main executable. It has /MP specified but does not have /YC specified for any file and does not contain an stdafx.h or stdafx.cpp. Instead I set the project's /YU to the stdafx.h of the pch library and /Fp to the pch generated by the pch library. I then set the pch library as a dependency of the exe project. I also set /FI on the exe project to forcibly include the stdafx.h from the pch library in each compilation unit.</p>
  
  <p>My problem is that, while the pch library DOES generate the pch file and the exe project does seem to reference the generated pch file correctly, as soon as the exe project starts to build (after some pre-build steps unrelated to the pch), it DELETES the pch generated by the pch library. I imagine it's because it thinks, with /Fp is specified, that the project will generate that file even though there are no /YC's specified.</p>
  
  <p>Is there something I'm doing wrong here? Am I missing a step. Is there a way to prevent the exe project from deleting my pch file before it starts building?</p>
  
  <p>Any help would be greatly appreciated!</p>