How to determine which dependency will lead to a rebuild of a C ++ compilation module?

I have a legacy C ++ application with a deep #includes graph. Changes to any header file often cause recompilation of seemingly unrelated source files.

The application is built using the Visual Studio 2005 Solution File (sln).

Is it possible to invoke MSBUILD so that it reports which dependency (s) cause recompilation of the source file?

Is there any other tool that can help?

NOTE. I am looking for a tool that will tell me why the file will be rebuilt, and not some restorative magic telling me why it was rebuilt.

+4
source share
3 answers

If you type a detailed description to a detailed one or higher (Tools> Options> Project> Build or / v: detail), then MSBuild will register, as soon as it starts the compiler, exactly which header file or source file caused the compiler to launch it.

Is this what you are asking for?

Dan / MSbuild

+2
source

There is a utility called makedepend . It is available on Unix platforms. In the window you can find a similar perl script here .

I don't think MSBUILD cares about dependency.

+1
source
0
source

Source: https://habr.com/ru/post/1307527/


All Articles