<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup Label="Globals">
    <ProjectGuid>{FB8E8D19-A4D6-4181-943C-282075F49B41}</ProjectGuid>
    <RootNamespace>fribidi</RootNamespace>
    <AegisubProjectType>lib</AegisubProjectType>
  </PropertyGroup>

  <!-- Aegisub project configuration -->
  <ImportGroup Label="PropertySheets">
    <Import Project="$(MSBuildThisFileDirectory)..\aegisub.props" />
  </ImportGroup>

  <!-- Project specific configuration -->
  <ItemDefinitionGroup>
    <ClCompile>
      <AdditionalIncludeDirectories>
        $(FribidiSrcDir)\lib;
        $(MSBuildThisFileDirectory);
        %(AdditionalIncludeDirectories)
      </AdditionalIncludeDirectories>
      <PreprocessorDefinitions>
        FRIBIDI_ENTRY=;
        %(PreprocessorDefinitions)
      </PreprocessorDefinitions>
    </ClCompile>
  </ItemDefinitionGroup>

  <!-- Download fribidi -->
  <UsingTask TaskName="TarballProject" AssemblyFile="$(AegisubBinaryDir)BuildTasks.dll" />
  <Target
    Name="Download"
    BeforeTargets="ClCompile"
    Inputs="$(FribidiSrcDir)aegisub.hash"
    Outputs="$(FribidiSrcDir)nonexistent-file"
    >
    <TarballProject
      Url="https://github.com/fribidi/fribidi/releases/download/0.19.6/fribidi-0.19.6.tar.bz2"
      Hash="cba8b7423c817e5adf50d28ec9079d14eafcec9127b9e8c8f1960c5ad585e17d"
      Root="$(FribidiSrcDir)"
      />
  </Target>

  <!-- Source files -->
  <ItemGroup>
    <ClCompile Include="$(FribidiSrcDir)\lib\fribidi-arabic.c" />
    <ClCompile Include="$(FribidiSrcDir)\lib\fribidi-bidi-types.c" />
    <ClCompile Include="$(FribidiSrcDir)\lib\fribidi-bidi.c" />
    <ClCompile Include="$(FribidiSrcDir)\lib\fribidi-deprecated.c" />
    <ClCompile Include="$(FribidiSrcDir)\lib\fribidi-joining-types.c" />
    <ClCompile Include="$(FribidiSrcDir)\lib\fribidi-joining.c" />
    <ClCompile Include="$(FribidiSrcDir)\lib\fribidi-mem.c" />
    <ClCompile Include="$(FribidiSrcDir)\lib\fribidi-mirroring.c" />
    <ClCompile Include="$(FribidiSrcDir)\lib\fribidi-run.c" />
    <ClCompile Include="$(FribidiSrcDir)\lib\fribidi-shape.c" />
    <ClCompile Include="$(FribidiSrcDir)\lib\fribidi.c" />
    <InstallHeader Include="$(FribidiSrcDir)\lib\*.h">
      <HeaderRoot>$(FribidiSrcDir)\lib</HeaderRoot>
    </InstallHeader>
    <InstallHeader Include="$(MSBuildThisFileDirectory)fribidi-config.h">
      <HeaderRoot>$(MSBuildThisFileDirectory)</HeaderRoot>
    </InstallHeader>
  </ItemGroup>
</Project>
