Advertisement
Guest User

Untitled

a guest
Mar 6th, 2013
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 10.63 KB | None | 0 0
  1. <!--
  2. ***********************************************************************************************
  3. Microsoft.BuildSteps.targets
  4.  
  5. WARNING:  DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
  6.           created a backup copy.  Incorrect changes to this file will make it
  7.           impossible to load or build your projects from the command-line or the IDE.
  8.  
  9. This file defines the steps in the standard build process for C++ projects.  It
  10. contains all the steps that are specific to building Visual C++ projects.
  11.  
  12. Copyright (C) Microsoft Corporation. All rights reserved.
  13. ***********************************************************************************************
  14. -->
  15.  
  16. <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  17.  
  18.    <PropertyGroup>
  19.       <!-- CLRSupport = pure, safe, true etc are supported -->
  20.       <GenerateTargetFrameworkAttribute Condition="'$(CLRSupport)' == '' or '$(CLRSupport)' == 'false' or '$(CLRSupport)' == 'oldsyntax'">false</GenerateTargetFrameworkAttribute>
  21.  
  22.       <!-- By default we do not want to build project to project references if they are disabled in the solution configuration -->
  23.       <OnlyReferenceAndBuildProjectsEnabledInSolutionConfiguration Condition="'$(OnlyReferenceAndBuildProjectsEnabledInSolutionConfiguration)' == ''">true</OnlyReferenceAndBuildProjectsEnabledInSolutionConfiguration>
  24.    </PropertyGroup>
  25.  
  26.    <Import Project="$(MSBuildToolsPath)\Microsoft.Common.Targets" />
  27.  
  28.     <!--
  29.     ============================================================
  30.                                         GenerateTargetFrameworkMonikerAttribute
  31.  
  32.     Emit any specified code fragments into a temporary source file for the compiler.
  33.     Overridden for C++ special care is needed when using precompiled headers.
  34.     ============================================================
  35.     -->
  36.  
  37.     <Target Name="GenerateTargetFrameworkMonikerAttribute"
  38.             BeforeTargets="ClCompile"
  39.             DependsOnTargets="PrepareForBuild;GetReferenceAssemblyPaths"
  40.             Inputs="$(VCTargetsPath)\Microsoft.BuildSteps.targets"
  41.             Outputs="$(TargetFrameworkMonikerAssemblyAttributesPath)"
  42.             Condition="'$(GenerateTargetFrameworkAttribute)' == 'true'">
  43.  
  44.         <PropertyGroup>
  45.           <!-- This attribute is only available in mscorlib v4 and later -->
  46.           <AdditionalSourcesText Condition="'$(GenerateTargetFrameworkAttribute)' == 'true' and '$(TargetingClr2Framework)' != 'true'">
  47.             $(AdditionalSourcesText)
  48. #using &lt;mscorlib.dll&gt;
  49. [assembly: System::Runtime::Versioning::TargetFrameworkAttribute(L&quot;$(TargetFrameworkMoniker)&quot;, FrameworkDisplayName=L&quot;$(TargetFrameworkMonikerDisplayName)&quot;)]%3b
  50.           </AdditionalSourcesText>
  51.         </PropertyGroup>
  52.  
  53.         <!-- This is a file shared between projects so we have to take care to handle simultaneous writes (by ContinueOnError)
  54.              and a race between clean from one project and build from another (by not adding to FilesWritten so it doesn't clean) -->
  55.        <WriteLinesToFile
  56.            File="$(TargetFrameworkMonikerAssemblyAttributesPath)"
  57.            Lines="$(AdditionalSourcesText)"
  58.            Condition="'$(AdditionalSourcesText)' != ''"
  59.            ContinueOnError="true"
  60.            Overwrite="true"/>
  61.  
  62.        <ItemGroup>
  63.           <ClCompile Include="$(TargetFrameworkMonikerAssemblyAttributesPath)" Condition="'@(ClCompile)' != '' and '$(AdditionalSourcesText)' != ''">
  64.              <!-- Since we didn't emit any necessary #include "stdafx.h" or similar -->
  65.               <PrecompiledHeader>NotUsing</PrecompiledHeader>
  66.               <!-- The appropriate CompileAsManaged setting will automatically be set depending on the current CLRSupport value -->
  67.            </ClCompile>
  68.         </ItemGroup>
  69.  
  70.     </Target>
  71.  
  72.   <!-- CPP build is done in 3 steps:
  73.           1. Generate sources (BuildGenerateSources)
  74.           2. Compile          (BuildCompile)
  75.           3. Link             (BuildLink)
  76.        Each step can be executed separately. Populate BuildSteps with one or more steps
  77.        before importing this project to build only particular steps. -->
  78.   <PropertyGroup>
  79.     <BuildSteps Condition="'$(BuildSteps)' == ''">
  80.       SetBuildDefaultEnvironmentVariables;
  81.       SetUserMacroEnvironmentVariables;
  82.       ResolveReferences;
  83.       PrepareForBuild;
  84.       InitializeBuildStatus;
  85.       BuildGenerateSources;
  86.       BuildCompile;
  87.       BuildLink;
  88.     </BuildSteps>
  89.  
  90.     <BuildDependsOn>
  91.       _PrepareForBuild;
  92.       $(BuildSteps);
  93.       AfterBuild;
  94.       FinalizeBuildStatus;
  95.     </BuildDependsOn>
  96.  
  97.     <RebuildDependsOn>
  98.       _PrepareForRebuild;
  99.       $(RebuildDependsOn);
  100.     </RebuildDependsOn>
  101.  
  102.     <CleanDependsOn>
  103.       _PrepareForClean;
  104.       $(CleanDependsOn);
  105.     </CleanDependsOn>
  106.   </PropertyGroup>
  107.  
  108.   <Target
  109.       Name="Build"
  110.       Condition=" '$(_InvalidConfigurationWarning)' != 'false' "
  111.  
  112.     DependsOnTargets="_DetermineManagedStateFromCL; $(BuildDependsOn)"
  113.     Returns="@(ManagedTargetPath)" >
  114.     <ItemGroup>
  115.       <ManagedTargetPath Include="$(TargetPath)" Condition="'$(ManagedAssembly)' == 'true'" />
  116.     </ItemGroup>
  117.   </Target>
  118.  
  119.   <Target
  120.       Name="Rebuild"
  121.       Condition=" '$(_InvalidConfigurationWarning)' != 'true' "
  122.       DependsOnTargets="_DetermineManagedStateFromCL;$(RebuildDependsOn)"
  123.       Returns="@(ManagedTargetPath)">
  124.     <ItemGroup>
  125.       <ManagedTargetPath Include="$(TargetPath)" Condition="'$(ManagedAssembly)' == 'true'" />
  126.     </ItemGroup>
  127.   </Target>
  128.  
  129.   <Target Name="_PrepareForBuild" >
  130.     <PropertyGroup>
  131.       <BuildType Condition="'$(BuildType)' == ''">Build</BuildType>
  132.     </PropertyGroup>
  133.  
  134.     <ItemGroup>
  135.       <!-- We only want to run our targets for vcxproj, not csproj.  This allows our us to target 3.5 toolset.-->
  136.       <Link Include="@(CustomBuild)" Condition="'%(CustomBuild.ExcludedFromBuild)'!='true' and ('%(CustomBuild.Extension)'=='.obj' or '%(CustomBuild.Extension)'=='.lib')" />
  137.       <Lib Include="@(CustomBuild)" Condition="'%(CustomBuild.ExcludedFromBuild)'!='true' and ('%(CustomBuild.Extension)'=='.obj' or '%(CustomBuild.Extension)'=='.lib')" />
  138.  
  139.       <!-- Remove CustomBuild ItemGroup that doesn't meet the condition. This prevents showing "Skipping target "CustomBuild" because it has no outputs. -->
  140.      <CustomBuildStep Remove="@(CustomBuildStep)" Condition="'%(CustomBuildStep.Command)' == ''" />
  141.      <CustomBuild Remove="@(CustomBuild)" Condition="'%(CustomBuild.Command)' == '' or '%(CustomBuild.ExcludedFromBuild)'=='true'" />
  142.    </ItemGroup>
  143.  </Target>
  144.  
  145.  <Target Name="_PrepareForRebuild">
  146.    <PropertyGroup>
  147.      <BuildType Condition="'$(BuildType)' == ''">Rebuild</BuildType>
  148.      <_ClCompileGenerateXMLDocumentationFiles Condition="%(ClCompile.GenerateXMLDocumentationFiles) == 'true'">true</_ClCompileGenerateXMLDocumentationFiles>
  149.    </PropertyGroup>
  150.    <!-- We only want to run our targets for vcxproj, not csproj.  This allows our us to target 3.5 toolset.-->
  151.    <ItemGroup>
  152.      <CustomBuildStep Remove="@(CustomBuildStep)" Condition="'%(CustomBuildStep.Command)' == ''" />
  153.      <CustomBuild Remove="@(CustomBuild)" Condition="'%(CustomBuild.Command)' == '' or '%(CustomBuild.ExcludedFromBuild)'=='true'" />
  154.    </ItemGroup>
  155.  </Target>
  156.  
  157.  <Target Name="_PrepareForClean">
  158.    <PropertyGroup>
  159.      <BuildType Condition="'$(BuildType)' == ''">Clean</BuildType>
  160.    </PropertyGroup>
  161.    <Delete Files="$(LastBuildState)" Condition="Exists($(LastBuildState))"/>
  162.  </Target>
  163.  
  164.  <Target Name="AfterBuild">
  165.  </Target>
  166.  
  167.  <PropertyGroup>
  168.    <TLogLocation>$(IntDir)</TLogLocation>
  169.    <LastBuildUnsuccessful>$(IntDir)$(ProjectName).unsuccessfulbuild</LastBuildUnsuccessful>
  170.    <LastBuildState>$(IntDir)$(ProjectName).lastbuildstate</LastBuildState>
  171.  </PropertyGroup>
  172.  
  173.  
  174.  <!-- *******************************************************************************************
  175.        BeforeBuildGenerateSources
  176.       ******************************************************************************************* -->
  177.  <!-- Redefine this target in your project in order to run tasks just before BuildGenerateSources -->
  178.  <Target Name="BeforeBuildGenerateSources"/>
  179.  
  180.  <PropertyGroup>
  181.    <BeforeBuildGenerateSourcesTargets>
  182.      $(BeforeBuildGenerateSourcesTargets);
  183.      BeforeBuildGenerateSources;
  184.    </BeforeBuildGenerateSourcesTargets>
  185.  
  186.    <AfterBuildGenerateSourcesTargets>
  187.      $(AfterBuildGenerateSourcesTargets);
  188.      AfterBuildGenerateSources;
  189.    </AfterBuildGenerateSourcesTargets>
  190.  </PropertyGroup>
  191.  
  192.  <!-- *******************************************************************************************
  193.        AfterBuildGenerateSources
  194.       ******************************************************************************************* -->
  195.  <!-- Redefine this target in your project in order to run tasks just after BuildGenerateSources -->
  196.  <Target Name="AfterBuildGenerateSources"/>
  197.  
  198.  <!-- *******************************************************************************************
  199.        BeforeBuildCompile
  200.       ******************************************************************************************* -->
  201.  <!-- Redefine this target in your project in order to run tasks just before BuildCompile -->
  202.  <Target Name="BeforeBuildCompile"/>
  203.  
  204.  <!-- *******************************************************************************************
  205.        AfterBuildCompile
  206.       ******************************************************************************************* -->
  207.  <!-- Redefine this target in your project in order to run tasks just after BuildCompile -->
  208.  <Target Name="AfterBuildCompile"/>
  209.  
  210.  <Target Name="LibLinkOnly"
  211.          DependsOnTargets="$(CommonBuildOnlyTargets)$(BeforeBuildLinkTargets);$(BuildLibTargets);$(BuildLinkTargets);$(AfterBuildLinkTargets)">
  212.  </Target>
  213.  
  214.  <!-- *******************************************************************************************
  215.          Utility targets to get files from project from another project using the MSBuild task
  216.       ******************************************************************************************* -->
  217.  <Target Name="GetClCompile" Returns="@(ClCompile)"/>
  218.  <Target Name="GetResourceCompile" Returns="@(ResourceCompile)"/>
  219.  <Target Name="GetMidl" Returns="@(Midl)"/>
  220.  <Target Name="GetImpLib" Returns="@(ImpLib)"/>
  221.  <Target Name="GetLib" Returns="@(Lib)"/>
  222.  <Target Name="GetLink" Returns="@(Link)"/>
  223.  <Target Name="GetCustomBuild" Returns="@(CustomBuild)"/>
  224.  <Target Name="GetXsd" Returns="@(Xsd)"/>
  225.  <Target Name="GetXdcMake" Returns="@(XdcMake)"/>
  226.  <Target Name="GetBscMake" Returns="@(BscMake)"/>
  227.  
  228. </Project>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement