Merge branch 'release' into release_candidate
[CRYENGINE.git] / _WAF_ / msbuild / waf_build.targets
blob491394444dce11d8ee301ad6631aad0a30d00f59
1 <!--
2 ***********************************************************************************************
3 waf_build.targets
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 CREATED: 08/10/2014 by Nico Moss
11 DESCRIPTION: This file defines the steps/targets required to build WAF based projects
13 Copyright (C), Crytek Studios, 2014. All rights reserved.
14 ***********************************************************************************************
15 -->
17 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">        
18         
19         <!-- *******************************************************************************************
20         Globals
21        ******************************************************************************************* -->  
22         <!-- Needed for single compile -->
23         <ItemGroup>
24     <AvailableItemName Include="ClCompile">
25       <Targets>ClCompile</Targets>
26     </AvailableItemName>
27         </ItemGroup>
28         
29         <PropertyGroup>
30                 <WAF_MSBuildDirectory>$(MSBuildProjectDirectory)\..\..\_WAF_\msbuild</WAF_MSBuildDirectory>
31         </PropertyGroup>                
32                 
33         <!-- *******************************************************************************************
34         Property pages 
35        ******************************************************************************************* -->  
36         <ItemGroup>
37                 <PropertyPageSchema Include="$(WAF_MSBuildDirectory)\waf_property_sheet.xml" Condition="Exists('$(WAF_MSBuildDirectory)\waf_property_sheet.xml')" />
38         </ItemGroup>
39         
40         <!-- *******************************************************************************************
41        Platform specific targets
42        ******************************************************************************************* -->  
43         <Import Project="$(WAF_MSBuildDirectory)\$(Platform)\$(Platform)_specific.targets" Condition="Exists('$(WAF_MSBuildDirectory)\$(Platform)\$(Platform)_specific.targets')" />
44                                 
45         <!-- *******************************************************************************************
46         Selective Build (reduce to selected CLCompile
47        ******************************************************************************************* -->
49   <Target Name="_SelectedFiles">                
50     <ItemGroup>
51       <SelectedFiles Include="$(SelectedFiles)"/>
52     </ItemGroup>
53     <PropertyGroup>
54       <BuildType Condition="'$(BuildType)' == ''">Build</BuildType>
55     </PropertyGroup>
56   </Target>
58   <Target Name="SelectClCompile"  BeforeTargets="ClCompile" DependsOnTargets="_SelectedFiles;">
59     <ItemGroup Condition="'@(SelectedFiles)'!=''">
60       <ClCompile Remove="@(ClCompile)" Condition="'%(Identity)'!='@(SelectedFiles)'"/>
61     </ItemGroup>
62   </Target>
64                 <!-- *******************************************************************************************
65         Build (WAF)
66        ******************************************************************************************* -->
67         <Target Name="WAF_BuildCore">
68                 <Message Text="Exec Command: %(ClCompile.WAF_BuildCommandLine)" />
69                 <Exec Command="%(ClCompile.WAF_BuildCommandLine)"  Condition="'%(ClCompile.WAF_BuildCommandLine)'!=''"/>
70         </Target>
71         
72         <Target Name="WAF_RebuildCore">
73                 <Message Text="Exec Command: %(ClCompile.WAF_RebuildCommandLine)" />
74                 <Exec Command="%(ClCompile.WAF_RebuildCommandLine)" Condition="'%(ClCompile.WAF_RebuildCommandLine)'!=''"/>
75         </Target>
76         
77         <Target Name="WAF_CleanCore">
78                 <Message Text="Exec Command: %(ClCompile.WAF_CleanCommandLine)" />
79                 <Exec Command="%(ClCompile.WAF_CleanCommandLine)"  Condition="'%(ClCompile.WAF_CleanCommandLine)'!=''"/>
80         </Target>
81                 
82         <Target Name="WAF_ClCompileCore" DependsOnTargets="SelectClCompile;" >
83                         
84                 <PropertyGroup>
85                         <_waf_single_compile_command Condition="'%(ClCompile.WAF_SingleCompilationMode)' == 'Code'"></_waf_single_compile_command>
86                         <_waf_single_compile_command Condition="'%(ClCompile.WAF_SingleCompilationMode)' == 'Disassembly'">--show-disassembly=True</_waf_single_compile_command>
87                         <_waf_single_compile_command Condition="'%(ClCompile.WAF_SingleCompilationMode)' == 'Preprocess'">--show-preprocessed-file=True</_waf_single_compile_command>
88                         <_waf_single_compile_command Condition="'%(ClCompile.WAF_SingleCompilationMode)' == 'Header'">--show-includes=True</_waf_single_compile_command>
89                 </PropertyGroup>                
90                         
91                 <!-- Execute compile selection of files-->                      
92                 <Message Text="Exec Command: %(ClCompile.WAF_BuildCommandLine) $(_waf_single_compile_command) --file-filter=@(ClCompile)" Condition="'%(ClCompile.WAF_BuildCommandLine)'!='' and '@(ClCompile)'!='' and '%(ClCompile.WAF_CommandOverride)' == ''"/>     
93                 <Exec Command="%(ClCompile.WAF_BuildCommandLine) $(_waf_single_compile_command) --file-filter=@(ClCompile)" Condition="'%(ClCompile.WAF_BuildCommandLine)'!='' and '@(ClCompile)'!='' and '%(ClCompile.WAF_CommandOverride)' == ''"/>           
94                 
95                 <!-- Execute override for WAF command files-->
96                 <Message Text="Exec Command: '%(ClCompile.WAF_ExecPath)' '%(ClCompile.WAF_CommandOverride)'" Condition="'%(ClCompile.WAF_CommandOverride)' != ''"/>
97                 <Exec Command="%(ClCompile.WAF_ExecPath) %(ClCompile.WAF_CommandOverride)" Condition="'%(ClCompile.WAF_CommandOverride)' != ''"/>
98                 
99         </Target>                        
101         <!-- *******************************************************************************************
102         Build
103        ******************************************************************************************* -->
104                          
105         <Target Name="Build" DependsOnTargets="WAF_BuildCore" >
106         </Target>
107         
108         <Target Name="Rebuild" DependsOnTargets="WAF_RebuildCore" >
109         </Target>
110         
111         <Target Name="Clean" DependsOnTargets="WAF_CleanCore" >
112         </Target>
113                 
114         <Target Name="ClCompile" DependsOnTargets="WAF_ClCompileCore" >
115         </Target>
116         
117         <!-- *******************************************************************************************
118                          !!! HACK !!!
119                          As a last thing set ConfigurationType -> Application
120                          This is after we loaded all MSBUILD common targets with the ConfigurationType specified by the project.
121                          Reason: Visual Studio appears to take the last ConfigurationType to enable/disable some features
122                                  e.g. "Single file compilation" and "Durango deploy and start debugging"
123                          ******************************************************************************************* -->        
124         <PropertyGroup>
125                 <ConfigurationType>Application</ConfigurationType>
126         </PropertyGroup>        
127         
128 </Project>