<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="..\common\common.props" />

  <ItemDefinitionGroup>
    <ClCompile>
      <PreprocessorDefinitions>%(PreprocessorDefinitions);CPUINFO_SHARED=1;ENABLE_VULKAN=1</PreprocessorDefinitions>
      <PreprocessorDefinitions Condition="'$(Platform)'!='ARM64'">%(PreprocessorDefinitions);ENABLE_OPENGL=1</PreprocessorDefinitions>
      <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(SolutionDir)dep\xxhash\include;$(SolutionDir)dep\kissfft\include;$(SolutionDir)dep\imgui\include;$(SolutionDir)dep\simpleini\include;$(SolutionDir)dep\libchdr\include;$(SolutionDir)dep\cubeb\include;$(SolutionDir)dep\d3d12ma\include;$(SolutionDir)dep\vulkan\include;$(SolutionDir)dep\ffmpeg\include</AdditionalIncludeDirectories>
      <AdditionalIncludeDirectories Condition="'$(Platform)'!='ARM64'">%(AdditionalIncludeDirectories);$(SolutionDir)dep\glad\include</AdditionalIncludeDirectories>
    </ClCompile>
  </ItemDefinitionGroup>

  <ItemDefinitionGroup>
    <Link>
      <AdditionalDependencies>%(AdditionalDependencies);d3d11.lib;d3d12.lib;d3dcompiler.lib;dxgi.lib;Dwmapi.lib;winhttp.lib</AdditionalDependencies>
      <AdditionalDependencies Condition="'$(Platform)'!='ARM64'">%(AdditionalDependencies);opengl32.lib</AdditionalDependencies>
    </Link>
  </ItemDefinitionGroup>

  <Import Condition="$(Configuration.Contains('Debug'))" Project="..\..\dep\winpixeventruntime\WinPixEventRuntime.props" />

  <!-- Dependency linking and DLL copying -->
  <ItemDefinitionGroup>
    <ClCompile>
      <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DepsIncludeDir)SDL2</AdditionalIncludeDirectories>
    </ClCompile>
    <Link>
      <AdditionalDependencies>%(AdditionalDependencies);cpuinfo.lib;freetype.lib;jpeg.lib;libpng16.lib;libwebp.lib;lunasvg.lib;SDL2.lib;soundtouch.lib;zlib.lib;zstd.lib</AdditionalDependencies>
    </Link>
  </ItemDefinitionGroup>
  <ItemGroup>
    <DepsDLLs Include="$(DepsBinDir)cpuinfo.dll" />
    <DepsDLLs Include="$(DepsBinDir)discord-rpc.dll" />
    <DepsDLLs Include="$(DepsBinDir)freetype.dll" />
    <DepsDLLs Include="$(DepsBinDir)harfbuzz.dll" />
    <DepsDLLs Include="$(DepsBinDir)jpeg62.dll" />
    <DepsDLLs Include="$(DepsBinDir)libpng16.dll" />
    <DepsDLLs Include="$(DepsBinDir)libsharpyuv.dll" />
    <DepsDLLs Include="$(DepsBinDir)libwebp.dll" />
    <DepsDLLs Include="$(DepsBinDir)lunasvg.dll" />
    <DepsDLLs Include="$(DepsBinDir)SDL2.dll" />
    <DepsDLLs Include="$(DepsBinDir)shaderc_shared.dll" />
    <DepsDLLs Include="$(DepsBinDir)soundtouch.dll" />
    <DepsDLLs Include="$(DepsBinDir)spirv-cross-c-shared.dll" />
    <DepsDLLs Include="$(DepsBinDir)zlib1.dll" />
    <DepsDLLs Include="$(DepsBinDir)zstd.dll" />
  </ItemGroup>
  <Target Name="DepsCopyDLLs"
    AfterTargets="Build"
    Inputs="@(DepsDLLs)"
    Outputs="@(DepsDLLs -> '$(OutDir)%(RecursiveDir)%(Filename)%(Extension)')">
    <Message Text="Copying Dependency DLLs" Importance="High" />
    <Copy
      SourceFiles="@(DepsDLLs)"
      DestinationFolder="$(OutDir)"
      SkipUnchangedFiles="true"
    />
  </Target>
</Project>
