forked from sharpdx/SharpDX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SharpDX.targets
255 lines (225 loc) · 12.6 KB
/
SharpDX.targets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
<!--
// Copyright (c) 2010-2013 SharpDX - Alexandre Mutel
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-->
<!--
This Target file must be imported in a project using SharpDX
It adds automatically references to SharpDX assemblies for
Toolkit based on the current .NET framework (select net20, net40 or winrt)
It compiles all files of type ToolkitFxc/ToolkitFont
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--Add ToolkitFxc as a new Build Action accessible on each File Properties-->
<ItemGroup>
<AvailableItemName Include="ToolkitFxc"></AvailableItemName>
<AvailableItemName Include="ToolkitFont"></AvailableItemName>
<AvailableItemName Include="ToolkitModel"></AvailableItemName>
<!-- Currently, toolkit texture is mostly a passthrough and copies the texture to the output directory -->
<!--But a future version may provide compression/rescale on the fly, so we need to introduce it now -->
<!--in order to keep project compatible-->
<AvailableItemName Include="ToolkitTexture"></AvailableItemName>
</ItemGroup>
<!-- Global property most of them are overridable in the project including this project file -->
<!-- The Most important variable is SharpDXSdkDir that should be a global system environement variable -->
<PropertyGroup>
<!--Detect SharpDX Platform based on .NETFramework version-->
<SharpDXDirectXVersion Condition="'$(SharpDXDirectXVersion)' == ''">DirectX11</SharpDXDirectXVersion>
<SharpDXPlatform Condition="'$(SharpDXPlatform)' == '' and '$(TargetFrameworkIdentifier)' == '.NETFramework' and ('$(TargetFrameworkVersion)' == 'v2.0' or '$(TargetFrameworkVersion)' == 'v3.5') ">DirectX11-net20</SharpDXPlatform>
<SharpDXPlatform Condition="'$(SharpDXPlatform)' == '' and '$(TargetFrameworkIdentifier)' == '.NETFramework' and ('$(TargetFrameworkVersion)' == 'v4.0' or '$(TargetFrameworkVersion)' == 'v4.5') ">$(SharpDXDirectXVersion)-net40</SharpDXPlatform>
<SharpDXPlatform Condition="'$(SharpDXPlatform)' == '' and '$(TargetFrameworkIdentifier)' == '.NETCore'">DirectX11_1-winrt</SharpDXPlatform>
<SharpDXPlatform Condition="'$(SharpDXPlatform)' == '' and '$(TargetFrameworkIdentifier)' == 'WindowsPhone' and '$(TargetFrameworkVersion)' == 'v8.0'">DirectX11_1-wp8-$(Platform)</SharpDXPlatform>
<!-- Variable used to select the platform used for the tool at compile time - default to Win8Desktop-net40 -->
<SharpDXPlatformTool Condition="'$(SharpDXPlatformTool)' == ''">DirectX11-net40</SharpDXPlatformTool>
<!-- Flag indicating the platform is desktop -->
<SharpDXIsPlatformDesktop Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">true</SharpDXIsPlatformDesktop>
<!--Root SharpDX SDK Directory where assemblies are stored. This variable should be set as a Global System Environement Variable -->
<SharpDXSdkDir Condition="'$(SharpDXSdkDir)' == ''">$(MSBuildThisFileDirectory)</SharpDXSdkDir>
<!--SharpDX Directory to link against - based on platform-->
<SharpDXSdkBinDir Condition="'$(SharpDXSdkBinDir)' == ''">$(SharpDXSdkDir)\Bin\$(SharpDXPlatform)</SharpDXSdkBinDir>
<!--SharpDX Directory used for compiling - Default to DirectX11-net40-->
<!--<SharpDXSdkToolsDir Condition="'$(SharpDXSdkToolsDir)' == ''">$(SharpDXSdkDir)\Bin\Win8Desktop-net40</SharpDXSdkToolsDir>-->
<SharpDXSdkToolsDir Condition="'$(SharpDXSdkToolsDir)' == ''">$(SharpDXSdkDir)\Bin\$(SharpDXPlatformTool)</SharpDXSdkToolsDir>
</PropertyGroup>
<!-- Automatically adds references to SharpDX assemblies for toolkit -->
<ItemGroup>
<Reference Include="SharpDX">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(SharpDXSdkBinDir)\SharpDX.dll</HintPath>
</Reference>
<Reference Include="SharpDX.Toolkit">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(SharpDXSdkBinDir)\SharpDX.Toolkit.dll</HintPath>
</Reference>
<Reference Include="SharpDX.Toolkit.Game">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(SharpDXSdkBinDir)\SharpDX.Toolkit.Game.dll</HintPath>
</Reference>
<Reference Include="SharpDX.Toolkit.Graphics">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(SharpDXSdkBinDir)\SharpDX.Toolkit.Graphics.dll</HintPath>
</Reference>
<Reference Include="SharpDX.Toolkit.Input">
<HintPath>$(SharpDXSdkBinDir)\SharpDX.Toolkit.Input.dll</HintPath>
</Reference>
<Reference Include="SharpDX.Direct3D11">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(SharpDXSdkBinDir)\SharpDX.Direct3D11.dll</HintPath>
</Reference>
<Reference Include="SharpDX.DXGI">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(SharpDXSdkBinDir)\SharpDX.DXGI.dll</HintPath>
</Reference>
</ItemGroup>
<!-- If we are on desktop, we can safely add a reference to Compiler -->
<ItemGroup Condition="Exists('$(SharpDXSdkBinDir)\SharpDX.Toolkit.Compiler.dll') and '$(TargetFrameworkIdentifier)' == '.NETFramework'">
<Reference Include="SharpDX.Toolkit.Compiler">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(SharpDXSdkBinDir)\SharpDX.Toolkit.Compiler.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup Condition="Exists('$(SharpDXSdkBinDir)\SharpDX.D3DCompiler.dll') and '$(TargetFrameworkIdentifier)' == '.NETFramework'">
<Reference Include="SharpDX.D3DCompiler">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(SharpDXSdkBinDir)\SharpDX.D3DCompiler.dll</HintPath>
</Reference>
</ItemGroup>
<!--Copy Assimp32 / Assimp64 dll on desktop-->
<ItemGroup Condition="Exists('$(SharpDXSdkBinDir)\Assimp32.dll') and '$(TargetFrameworkIdentifier)' == '.NETFramework'">
<Content Include="$(SharpDXSdkBinDir)\Assimp32.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Link>Assimp32.dll</Link>
</Content>
</ItemGroup>
<ItemGroup Condition="Exists('$(SharpDXSdkBinDir)\Assimp64.dll') and '$(TargetFrameworkIdentifier)' == '.NETFramework'">
<Content Include="$(SharpDXSdkBinDir)\Assimp64.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Link>Assimp32.dll</Link>
</Content>
</ItemGroup>
<!-- If we are on desktop or WinRT, we can safely add a reference to Direct2D1 -->
<ItemGroup Condition="Exists('$(SharpDXSdkBinDir)\SharpDX.Direct2D1.dll') and ('$(TargetFrameworkIdentifier)' == '.NETFramework' or '$(TargetFrameworkIdentifier)' == '.NETCore')">
<Reference Include="SharpDX.Direct2D1">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(SharpDXSdkBinDir)\SharpDX.Direct2D1.dll</HintPath>
</Reference>
</ItemGroup>
<!--
From C:\Program Files (x86)\MSBuild\Microsoft\XNA Game Studio\v4.0\Microsoft.Xna.GameStudio.Common.targets
In VS 2008, a new feature was introduced to speed up the "F5" scenario when
no changes have occurred. It does this by skipping the build entirely if the
IDE believes there are no changes. This is fast, but unreliable because it
does not check all the same files as msbuild does. In XNA game projects, for
example, the IDE does not check if any content needs to be rebuilt. As a
result, F5 is way faster, but you may start debugging a project that is out
of date. To disable the new feature, we set DisableFastUpToDateCheck to true.
-->
<!--<PropertyGroup>
<DisableFastUpToDateCheck>true</DisableFastUpToDateCheck>
</PropertyGroup>-->
<UsingTask TaskName="SharpDX.Toolkit.EffectCompilerTask" AssemblyFile="$(SharpDXSdkToolsDir)\SharpDX.Toolkit.CompilerTask.dll"/>
<UsingTask TaskName="SharpDX.Toolkit.FontCompilerTask" AssemblyFile="$(SharpDXSdkToolsDir)\SharpDX.Toolkit.CompilerTask.dll"/>
<UsingTask TaskName="SharpDX.Toolkit.CompilerDependencyTask" AssemblyFile="$(SharpDXSdkToolsDir)\SharpDX.Toolkit.CompilerTask.dll"/>
<UsingTask TaskName="SharpDX.Toolkit.ModelCompilerTask" AssemblyFile="$(SharpDXSdkToolsDir)\SharpDX.Toolkit.CompilerTask.dll"/>
<UsingTask TaskName="SharpDX.Toolkit.TextureCompilerTask" AssemblyFile="$(SharpDXSdkToolsDir)\SharpDX.Toolkit.CompilerTask.dll"/>
<!-- Plugs all compilers in BuildDependsOn -->
<PropertyGroup>
<BuildDependsOn>
TkCompileTarget;
$(BuildDependsOn);
</BuildDependsOn>
<ToolkitFxcDebugOption>true</ToolkitFxcDebugOption>
<ToolkitFxcDebugOption Condition="$(Optimize) == 'true'">false</ToolkitFxcDebugOption>
</PropertyGroup>
<!-- Plugs all dependency listing in AssignTargetPathsDependsOn - in order to support generated output to be copied as part of the build -->
<PropertyGroup>
<AssignTargetPathsDependsOn>
$(AssignTargetPathsDependsOn);
TkListContentAndCompileTarget;
</AssignTargetPathsDependsOn>
<IsBuildInDebug>true</IsBuildInDebug>
<IsBuildInDebug Condition="$(Optimize) == 'true'">false</IsBuildInDebug>
<!--By default turn-on debugging on tkfxc when compiling in debug (no optimize)-->
<ToolkitFxcDebugOption Condition="'$(ToolkitFxcDebugOption)' == ''">$(IsBuildInDebug)</ToolkitFxcDebugOption>
<!--By default turn-on dynamic compiling on tkfxc when compiling in debug (no optimize)-->
<ToolkitFxcDynamicCompilingOption Condition="'$(ToolkitFxcDynamicCompilingOption)' == ''">$(IsBuildInDebug)</ToolkitFxcDynamicCompilingOption>
</PropertyGroup>
<!-- Target used to calculate dependency output -->
<Target Name="TkListContentAndCompileTarget">
<!--<Message Importance="high" Text="AssignTargetPathsDependsOn @(ToolkitFxc)"/>-->
<CompilerDependencyTask
ProjectDirectory="$(ProjectDir)"
IntermediateDirectory="$(IntermediateOutputPath)"
Debug="$(ToolkitFxcDebugOption)"
Files="@(ToolkitFxc);@(ToolkitFont);@(ToolkitModel);@(ToolkitTexture)"
RootNamespace="$(RootNamespace)"
>
<Output TaskParameter="ContentFiles" ItemName="TkContent"/>
<Output TaskParameter="CompileFiles" ItemName="TkCompile"/>
</CompilerDependencyTask>
<ItemGroup>
<!--List Of fxo compiled file-->
<Content Include="@(TkContent)" KeepMetadata="Link;CopyToOutputDirectory"/>
<!--List of cs compiled file-->
<Compile Include="@(TkCompile)"/>
</ItemGroup>
</Target>
<!-- Target used to compile content (Font/Fx files...) -->
<Target Name="TkCompileTarget">
<EffectCompilerTask
ProjectDirectory="$(ProjectDir)"
IntermediateDirectory="$(IntermediateOutputPath)"
DynamicCompiling="$(ToolkitFxcDynamicCompilingOption)"
Debug="$(ToolkitFxcDebugOption)"
Files="@(ToolkitFxc)"
RootNamespace="$(RootNamespace)"
>
</EffectCompilerTask>
<!--TODO Merge both task into a single one?-->
<FontCompilerTask
ProjectDirectory="$(ProjectDir)"
IntermediateDirectory="$(IntermediateOutputPath)"
DynamicCompiling="$(ToolkitFxcDynamicCompilingOption)"
Debug="$(ToolkitFxcDebugOption)"
Files="@(ToolkitFont)"
RootNamespace="$(RootNamespace)"
>
</FontCompilerTask>
<!--TODO Merge both task into a single one?-->
<ModelCompilerTask
ProjectDirectory="$(ProjectDir)"
IntermediateDirectory="$(IntermediateOutputPath)"
DynamicCompiling="$(ToolkitFxcDynamicCompilingOption)"
Debug="$(ToolkitFxcDebugOption)"
Files="@(ToolkitModel)"
RootNamespace="$(RootNamespace)"
>
</ModelCompilerTask>
<!--TODO Merge both task into a single one?-->
<TextureCompilerTask
ProjectDirectory="$(ProjectDir)"
IntermediateDirectory="$(IntermediateOutputPath)"
DynamicCompiling="$(ToolkitFxcDynamicCompilingOption)"
Debug="$(ToolkitFxcDebugOption)"
Files="@(ToolkitTexture)"
RootNamespace="$(RootNamespace)"
>
</TextureCompilerTask>
</Target>
</Project>