Curious if anyone knows how to troubleshoot this; I have a particular .cpp file that, for some reason, whenever I modify it (even just adding a whitespace character) and build the project, causes a recompile of a host of other unrelated .cpp files (10-20 of them).
That file isn't #include'd in any other files (I never #include .cpp files directly, only .h) and there are no other dependencies I can think of - it seems to me like Visual Studio is misunderstanding the dependency tree, or has some corrupt internal state related to its build process. I've tried deleting the .sdf, .suo, ipch/, .user, and object file directories, but the problem appears again after a short time.
Modifying any other .cpp file causes a recompile of that file only, as expected.
I know a bit about MSBuild but don't see anything clearly amiss in the .vxproj file - the .cpp file in question only appears once in the ClCompile item group, and its header only appears once in the ClInclude group.
If this rings any bells, or if anyone has any tips on how I might go about tracking this down and troubleshooting it, it'd be greatly appreciated!
UPDATE:
I ran msbuild /verbosity:Detailed
but unfortunately its explanation for why the unrelated files are getting compiled is just as opaque:
Using "CL" task from assembly "Microsoft.Build.CppTasks.Common.v110, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
Task "CL"
Read Tracking Logs:
Debug\cl.read.1.tlog
Output details (109 of them) were not logged for performance reasons.
{UnrelatedFile1.cpp} will be compiled as {PROBLEM_FILE.CPP} was modified at 4/30/2013 3:28:02 PM.
{UnrelatedFile2.cpp} will be compiled as {PROBLEM_FILE.CPP} was modified at 4/30/2013 3:28:02 PM.
(etc...)
If this makes sense to anybody let me know - can't seem to find much info on the inner workings of the CL task or why it would be seeing a dependency between these unrelated CPP files.