Friday, April 3, 2015

MSBuild C++ 예제 1/2

Target을 import하지 않고 직접 만들어서 CL Task를 사용한 MSBuild C++ 샘플
MSBuild C++은 Visual Studio 2010에서만 동작한다.

<Project DefaultTargets="Build" ToolsVersion="4.0"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
             <Import Project="$(VCTargetsPath)\Microsoft.Cpp.default.props" />
             <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Targets" />
             <ItemGroup>
                           <ClCompile Include="main.cpp" />
             </ItemGroup>
             <Target Name="Build">
                           <Cl Sources="@(ClCompile)">
                                        <Output TaskParameter="ObjectFiles" ItemName="Objects" />
                           </Cl>
                           <Link Sources="@(Objects)"/>
                           <Message Text="The output file is @(Objects)" />
             </Target>
</Project>

No comments:

Post a Comment