cotire icon indicating copy to clipboard operation
cotire copied to clipboard

Compiling a certain source file triggers recompilation of all other source files when using MSVC

Open Knitschi opened this issue 7 years ago • 1 comments

Hi,

When I enable cotire, I get the behaviour, that all .cpp files in the target depend on first .cpp file of the target when compiling with msvc. Looking a little deeper into it, I found out that the first .cpp file has the \Yc option set to create the .pch precompiled header file, on which all other .cpp files depend. -> this triggers the recompilation of the others.

  • So is this the intended behavior that comes from the current implementation or is it a bug?
  • If it is the intended behavior, I suggest changing the implementation to create an extra .cpp file that only includes the prefix header and wich is used to create the .pch file with the /Yc option. This would remove the unnecessary rebuilds when working on the .cpp file that happens to create the precompiled header.

Knitschi avatar Jul 20 '17 11:07 Knitschi

At https://github.com/TrinityCore/TrinityCore we recently started using cotire and ran into this exact same issue. Could any cotire maintainer reply to this issue ? Just to get an idea if we should move away from cotire.

jackpoz avatar Jan 06 '18 13:01 jackpoz