自定义Visual Studio编译器缓存 [英] Custom a Visual studio compiler cache

查看:110
本文介绍了自定义Visual Studio编译器缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有很多通过局域网连接的机器。并且它们具有相同的源代码。


当其中一个构建代码时,在这种情况下从cpp文件到obj文件。完成后,它会将这些obj文件复制到共享文件夹。然后我希望其他机器从共享文件夹中复制obj而不是再次编译源代码。这就是我调用
缓存的原因。


我用visual studio尝试这种方法,当然它不起作用。


你能否建议我自己应用一些想法或方法?

解决方案

Hi Tieu Dinh Huong,


< p style ="margin-bottom:12pt"> 欢迎来到MSDN论坛。


>>然后我希望其他机器从共享文件夹而不是再次编译源文件中复制obj。


据我所知,你可以使用

MSBuild命令:复制任务
将共享文件夹复制到obj文件夹中,请看一下示例:


  < Project xmlns =" http://schemas.microsoft.com/developer/msbuild/2003">  


<跨度>&NBSP;&NBSP;&NBSP;
< ItemGroup>  


<跨度>&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;
< MySourceFiles Include =" a.cs; b.cs; c.cs" />  


<跨度>&NBSP;&NBSP;&NBSP;
< / ItemGroup>  


<跨度>&NBSP;&NBSP;&NBSP;
<目标名称=" CopyFiles">  


<跨度>&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;
<复制 


<跨度>&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;
SourceFiles =" @(MySourceFiles)"  


<跨度>&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;
DestinationFolder =" c:\ MyProject \Destination"  


<跨度>&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;
/>  


<跨度>&NBSP;&NBSP;&NBSP;
< / Target>  


< /项目> <跨度>&NBSP;



最好的问候,


Sara


I have many machines which connects through LAN. And they have same source code.

When one of them build code, in this case from cpp files to obj files. When it finishes, it will copy these obj files to a shared folder. Then I want other machines to copy obj from shared folder instead of compile source again.That's why I called cache.

I try this method with visual studio and of course it doesn't work.

Could you suggest me some idea or method which I can apply myself?

解决方案

Hi Tieu Dinh Huong,

Welcome to the MSDN forum.

>> Then I want other machines to copy obj from shared folder instead of compile source again.

As far as I know, you can use the MSBuild command: Copy Task to copy the shared folder into the obj folder, please have a look at the example:

 <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 

    <ItemGroup> 

        <MySourceFiles Include="a.cs;b.cs;c.cs"/> 

    </ItemGroup> 

    <Target Name="CopyFiles"> 

        <Copy 

            SourceFiles="@(MySourceFiles)" 

            DestinationFolder="c:\MyProject\Destination" 

        /> 

    </Target> 

</Project> 

Best regards,

Sara


这篇关于自定义Visual Studio编译器缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆