mirror of
https://github.com/AlexMacocian/WpfExtended.git
synced 2026-07-15 14:59:30 +00:00
32 lines
1.6 KiB
SYSTEMD
32 lines
1.6 KiB
SYSTEMD
<?xml version="1.0" encoding="utf-8"?>
|
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
<PropertyGroup>
|
|
<ShaderDir>$(ProjectDir)</ShaderDir>
|
|
<!-- Use MSBuildProjectDirectory to get a more reliable path to the solution root -->
|
|
<SolutionRootDir Condition="'$(SolutionDir)' == '' OR '$(SolutionDir)' == '*Undefined*'">$(MSBuildProjectDirectory)\..</SolutionRootDir>
|
|
<SolutionRootDir Condition="'$(SolutionDir)' != '' AND '$(SolutionDir)' != '*Undefined*'">$(SolutionDir)</SolutionRootDir>
|
|
<Fxc>$(SolutionRootDir)\tools\fxc.exe</Fxc>
|
|
<FxcArgs>/O3 /T ps_3_0 /nologo /Fo</FxcArgs>
|
|
</PropertyGroup>
|
|
|
|
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
|
|
<!-- Check if fxc.exe exists before attempting compilation -->
|
|
<PropertyGroup>
|
|
<FxcExists Condition="Exists('$(Fxc)')">true</FxcExists>
|
|
</PropertyGroup>
|
|
|
|
<Message Importance="High" Text="Looking for fxc.exe at: $(Fxc)" />
|
|
<Message Condition="'$(FxcExists)' == 'true'" Importance="High" Text="Compiling shader effect files..." />
|
|
<Message Condition="'$(FxcExists)' != 'true'" Importance="High" Text="fxc.exe not found at $(Fxc), using pre-compiled shaders..." />
|
|
|
|
<ItemGroup Condition="'$(FxcExists)' == 'true'">
|
|
<_ShaderFiles Include="$(ShaderDir)**\*.fx" />
|
|
</ItemGroup>
|
|
|
|
<Exec Condition="'$(FxcExists)' == 'true'" Command=""$(Fxc)" $(FxcArgs) "$([System.IO.Path]::ChangeExtension('%(_ShaderFiles.Identity)', '.ps'))" "%(_ShaderFiles.Identity)"" />
|
|
|
|
<ItemGroup>
|
|
<Resource Include="$(ShaderDir)**\*.ps" />
|
|
</ItemGroup>
|
|
</Target>
|
|
</Project> |