Fix first time compilation issues

Fix including obj directories
This commit is contained in:
TSR Berry 2022-12-15 21:52:19 +01:00
parent 2fc980ef9e
commit 8ccbeb3a5a
No known key found for this signature in database
GPG key ID: 52353C0A4CCA15E2
2 changed files with 5 additions and 9 deletions

View file

@ -180,7 +180,7 @@ namespace Ryujinx.CustomTasks
{
string fullPath = item.GetMetadata("FullPath");
if (fullPath.EndsWith(".g.cs") || fullPath.Contains("obj\\Debug\\") || fullPath.Contains("obj\\Release\\"))
if (fullPath.EndsWith(".g.cs") || fullPath.Contains(Path.Combine("obj","Debug")) || fullPath.Contains(Path.Combine("obj", "Release")))
{
continue;
}

View file

@ -10,20 +10,16 @@
<!--A target that generates code, which is executed before the compilation-->
<!-- TODO: Make "Outputs" more generic -->
<Target Name="BeforeCompile" Inputs="@(ArrayInputFiles)" Outputs="$(ArrayOutputPath)\Arrays.g.cs">
<Target Name="BeforeCompile" Inputs="@(ArrayInputFiles)" Outputs="$(ArrayOutputPath)\Arrays.g.cs;$(ArrayOutputPath)\IArray.g.cs">
<!--Calling our custom task -->
<GenerateArrays ArrayNamespace="$(ArrayNamespace)" InputFiles="@(ArrayInputFiles)" OutputPath="$(ArrayOutputPath)">
<Output TaskParameter="OutputFiles" PropertyName="ArrayOutputFiles" />
<!--Our generated files are included to be compiled-->
<Output TaskParameter="OutputFiles" ItemName="Compile" />
</GenerateArrays>
<!--Our generated files are included to be compiled-->
<ItemGroup>
<Compile Remove="@(ArrayOutputFiles)" />
<Compile Include="@(ArrayOutputFiles)" />
</ItemGroup>
</Target>
<!--The generated files are deleted after a general clean. It will force the regeneration on rebuild -->
<Target Name="AfterClean">
<Delete Files="$(ArrayOutputPath)\*.g.cs" />
<Delete Files="$(ArrayOutputPath)\Arrays.g.cs;$(ArrayOutputPath)\IArray.g.cs" />
</Target>
</Project>