-
Notifications
You must be signed in to change notification settings - Fork 0
/
CeresGPU.targets
83 lines (71 loc) · 5.12 KB
/
CeresGPU.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
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildThisFileDirectory)FindPythonTask.targets" />
<ItemGroup>
<GlslVertFile Include="**\*.vert.glsl">
<GgenVersionFile>%(RecursiveDir)%(Filename).ggen_version</GgenVersionFile>
<CsFile>%(RecursiveDir)$([System.IO.Path]::GetFileNameWithoutExtension('%(Filename)')).Generated.cs</CsFile>
<LogicalDirectory>$(MSBuildProjectName).$([System.String]::new('%(RecursiveDir)').Replace('/', '.').Replace('\', '.'))</LogicalDirectory>
</GlslVertFile>
<GlslFragFile Include="**\*.frag.glsl">
<GgenVersionFile>%(RecursiveDir)%(Filename).ggen_version</GgenVersionFile>
<LogicalDirectory>$(MSBuildProjectName).$([System.String]::new('%(RecursiveDir)').Replace('/', '.').Replace('\', '.'))</LogicalDirectory>
</GlslFragFile>
</ItemGroup>
<ItemGroup>
<GgenScript Include="$(MSBuildThisFileDirectory)\ggen\**\*.py">
<Link>%(RelativeDir)/%(Filename).%(Extension)</Link>
</GgenScript>
</ItemGroup>
<ItemGroup>
<!--
Define as an Item outside of the Target so that IDEs can pick up on these files.
This seemed to be an issue with Rider, not sure if it's an issue with Visual Studio or not.
-->
<Compile Include="@(GlslVertFile -> '$(IntermediateOutputPath)ggen/%(CsFile)')">
<Link>%(CsFile)</Link>
</Compile>
</ItemGroup>
<Target Name="ggen" AfterTargets="AfterResolveReferences" BeforeTargets="BeforeCompile;PrepareResourceNames">
<Message Importance="high" Text="Running ggen..." />
<FindPythonTask>
<Output TaskParameter="PythonPath" PropertyName="Python" />
</FindPythonTask>
<Exec
WorkingDirectory="$(MSBuildThisFileDirectory)"
Command="$(Python) -m ggen "$(MSBuildProjectDirectory)" --ggen-script-files "@(GgenScript)" --files "@(GlslVertFile -> '%(FullPath)');@(GlslFragFile -> '%(FullPath)')" --output-dir "$(MSBuildProjectDirectory)/$(IntermediateOutputPath)ggen""
/>
<ItemGroup>
<Compile Remove="@(GlslVertFile -> '$(IntermediateOutputPath)ggen/%(CsFile)')" />
<Compile Include="@(GlslVertFile -> '$(IntermediateOutputPath)ggen/%(CsFile)')">
<Link>%(GlslVertFile.CsFile)</Link>
</Compile>
<EmbeddedResource Include="@(GlslVertFile -> '$(IntermediateOutputPath)ggen/%(RecursiveDir)/%(Filename).spv')">
<LogicalName>%(GlslVertFile.LogicalDirectory)%(GlslVertFile.Filename).spv</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="@(GlslVertFile -> '$(IntermediateOutputPath)ggen/%(RecursiveDir)/%(Filename)_gl.glsl')">
<LogicalName>%(GlslVertFile.LogicalDirectory)%(GlslVertFile.Filename)_gl.glsl</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="@(GlslVertFile -> '$(IntermediateOutputPath)ggen/%(RecursiveDir)/%(Filename).metal')">
<LogicalName>%(GlslVertFile.LogicalDirectory)%(GlslVertFile.Filename).metal</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="@(GlslFragFile -> '$(IntermediateOutputPath)ggen/%(RecursiveDir)/%(Filename).spv')">
<LogicalName>%(GlslFragFile.LogicalDirectory)%(GlslFragFile.Filename).spv</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="@(GlslFragFile -> '$(IntermediateOutputPath)ggen/%(RecursiveDir)/%(Filename)_gl.glsl')">
<LogicalName>%(GlslFragFile.LogicalDirectory)%(GlslFragFile.Filename)_gl.glsl</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="@(GlslFragFile -> '$(IntermediateOutputPath)ggen/%(RecursiveDir)/%(Filename).metal')">
<LogicalName>%(GlslFragFile.LogicalDirectory)%(GlslFragFile.Filename).metal</LogicalName>
</EmbeddedResource>
<FileWrites Include="@(GlslVertFile -> '$(IntermediateOutputPath)ggen/%(CsFile)')" />
<FileWrites Include="@(GlslVertFile -> '$(IntermediateOutputPath)ggen/%(RelativeDir)%(Filename).spv')" />
<FileWrites Include="@(GlslFragFile -> '$(IntermediateOutputPath)ggen/%(RelativeDir)%(Filename).spv')" />
<FileWrites Include="@(GlslVertFile -> '$(IntermediateOutputPath)ggen/%(RelativeDir)%(Filename).reflection.json')" />
<FileWrites Include="@(GlslFragFile -> '$(IntermediateOutputPath)ggen/%(RelativeDir)%(Filename).reflection.json')" />
<FileWrites Include="@(GlslVertFile -> '$(IntermediateOutputPath)ggen/%(RelativeDir)%(Filename)_gl.glsl')" />
<FileWrites Include="@(GlslFragFile -> '$(IntermediateOutputPath)ggen/%(RelativeDir)%(Filename)_gl.glsl')" />
<FileWrites Include="@(GlslVertFile -> '$(IntermediateOutputPath)ggen/%(RelativeDir)%(Filename).metal')" />
<FileWrites Include="@(GlslFragFile -> '$(IntermediateOutputPath)ggen/%(RelativeDir)%(Filename).metal')" />
</ItemGroup>
</Target>
</Project>