Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do some C++ project builds show 00:00:00 elapsed time and no Output window detail?

We have a 160+ project VS2010 C++ solution. I start with a completely empty output directory, and "Build Solution". I have the IDE build verbosity set to Normal. During the build, I watch the Output window. (VS2010 is set to build 2 projects at a time, each compiling only 1 .cpp file at a time.)

Most projects show numerous output lines from the compiler (each .cpp filename) and the librarian/linker.

But -some- projects (10 in the latest run) show EXTREMELY minimal output. Example:

29>------ Build started: Project: DebuggingService (LHFramework\DebuggingService\DebuggingService), Configuration: Debug x64 ------
29>Build started 8/17/2011 3:23:24 PM.
29>
29>Build succeeded.
29>
29>Time Elapsed 00:00:00

The projects showing these symptoms are -not- disabled, they have many .cpp files, and the appropriate result files (.obj, .lib, .exe, etc.) -are- produced by this build.

When I empty the build output directory and rerun the build from scratch, a different set of projects may show those symptoms!

It appears that those project builds =are= happening (obviously taking more than 00:00:00), but the display in the Output window is skipped. I don't know any project settings that affect build output: I think it's controlled by only IDE-level settings. In any case, we use the same settings for all projects, so they should all show the same level of output detail.

The .log file contains just the last five lines of the output above, minus the leading "29>" indicator. There are various .tlog files created: 3 from "cl", 3 from "custombuild", 3 from "lib". I can almost figure out what they mean. :)

PROBABLY IMPORTANT NOTE: Our .sln/.vcxproj/etc files are generated by CMake. I didn't set that up, but all projects have a custom build step to run CMake to determine what work needs done (compile/link/etc).

SO... Is this a known problem with VS2010? Or have we stumbled on some VS2010<->CMake interaction?

Mike

like image 582
Mike Avatar asked Aug 18 '11 22:08

Mike


2 Answers

I have not heard of this particular issue at all, but make sure you try using the latest version of CMake with Visual Studio 2010. The latest official release was from early July, CMake 2.8.5. And the first release candidate for CMake 2.8.6-rc1 just came out yesterday.

Earlier versions of CMake had several known issues (although not this one to my knowledge) with VS 2010 solutions, and many have been fixed as of 2.8.5. There were some very vexing custom build rule issues that took several iterations to address fully.

Give CMake 2.8.5 or 2.8.6-rc1 a shot. Perhaps this issue is related to something that has been fixed already...

like image 193
DLRdave Avatar answered Nov 15 '22 05:11

DLRdave


It sounds to me like project dependencies are causing projects to be triggered for build more than once, and on the second call the project is skipped because it doesn't need to be rebuilt. Timing differences would explain why you see different projects with this behavior each time.

In the logs, are there previous instances of the project that shows the 00:00:00 elapsed time? That would be a good indicator of whether it was previously built.

You can also turn up the MSBuild verbosity in Visual Studio by going to Tools > Options > Projects and Solutions > Build and Run. Set "MSBuild project build log file verbosity" to "Detailed" or "Diagnostic" and see if there's anything more interesting in your logs.

like image 45
Scott Wegner Avatar answered Nov 15 '22 07:11

Scott Wegner