I’d like to know how to do something about ‘inherited values’ in Visual Studio 2012’s property pages. In my project, I’ve decided I want to use precompiled headers, so naturally, I tried removing *.pch from the list of extensions to delete on Clean. However, it turns out it’s listed, among many other extensions, under the read-only ‘Inherited values’ box when I try editing this property.
‘Inherit from parent or project defaults’ is not ticked, but it makes no difference. My .pch file is deleted when I clean the solution nonetheless.
Thanks in advance.
If you setup PCH using traditional PCH semantics, then one file is used to generate the PCH (usually stdafx.cpp) and the rest of the source files benefit from that creation. If this is the case then what you’re experiencing is the removal of the .obj of the ‘creator” source forcing a rebuild of the “generator” .cpp file, which means the PCH will be rebuilt as well. The PCH is implicitly added to the output targets of the “generator” source and by definition all output targets are removed for a given source target when it is “cleaned”
In other words, the PCH is being rebuilt because the source file that generates it is also being rebuilt, and that because the Clean deleted that source files generated .obj.
This is expected behavior on a clean, by the way.