[cfe-dev] Why copy_if_different?

Francois Pichet pichet2000 at gmail.com
Fri Apr 29 02:48:17 PDT 2011


On Fri, Apr 29, 2011 at 5:34 AM, Yuri Gribov <tetra2005 at googlemail.com> wrote:
> On Fri, Apr 29, 2011 at 1:15 PM, Francois Pichet <pichet2000 at gmail.com> wrote:
>> On Fri, Apr 29, 2011 at 5:09 AM, Yuri Gribov <tetra2005 at googlemail.com> wrote:
>>> Hi all,
>>>
>>> What is the reason for custom build rules in Visual Studion using
>>> 'cmake -E copy_if_different' instead of plain 'cmake -E copy'? If
>>> target file is older than source but contents is the same the source
>>> will not be copied and the timestamp of target will remain the same.
>>> This means that VS will try to rebuild this file (and a dozen of
>>> dependent projects) on every run (I observe this particular behavior
>>> on my system).
>>
>> I too observed this behaviour with MSVC 2008 but not with MSVC 2010.
>> That's one of the reason i switched from 2008 to 2010.
>>
>
> I really do not think that this behavior depends on particular version of VS.

I don't know. MSVC 2010 now use MSBUILD under the hood to build.
MSBUILD wasn't used with 2008 for C++ project. There could be side
effects to that. As I said I never observed even one case of
unnecessary recompilation with 2010, something I was seeing very often
with 2008. I really don't know why though.



More information about the cfe-dev mailing list