<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp3.1</TargetFramework>
    <LangVersion>8.0</LangVersion>
  </PropertyGroup>

  <PropertyGroup>
    <VersionPrefix>0.12.0</VersionPrefix>
    <PathMap Condition=" '$(BuildType)' == 'Release' ">$(MSBuildProjectDirectory)=C:/hactoolnet/</PathMap>
  </PropertyGroup>

  <ItemGroup>
    <None Remove="CA00000003_XS00000020" />
    <EmbeddedResource Include="CA00000003_XS00000020" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\LibHac\LibHac.csproj" />
  </ItemGroup>

  <!-- Options for use with CoreRT -->
  <ItemGroup Condition=" $(BuildType.StartsWith('native')) ">
    <PackageReference Include="Microsoft.DotNet.ILCompiler" Version="1.0.0-alpha-*" />
  </ItemGroup>

  <PropertyGroup Condition=" $(BuildType.StartsWith('native')) and '$(BuildType)' != 'native-untrimmed' ">
    <IlcFoldIdenticalMethodBodies>true</IlcFoldIdenticalMethodBodies>
    <IlcGenerateCompleteTypeMetadata>false</IlcGenerateCompleteTypeMetadata>
    <IlcOptimizationPreference>Speed</IlcOptimizationPreference>
    <RootAllApplicationAssemblies>false</RootAllApplicationAssemblies>
  </PropertyGroup>

  <ItemGroup Condition=" $(BuildType.StartsWith('native')) and '$(OS)' == 'Windows_NT' and '$(BuildType)' != 'native-untrimmed' ">
    <IlcArg Include="--removefeature:EventSource" />
  </ItemGroup>

  <!-- No-reflection mode might not work on Linux if the HOME environment variable is not set -->
  <PropertyGroup Condition=" '$(BuildType)' == 'native-noreflection' ">
    <IlcDisableReflection>true</IlcDisableReflection>
    <DefineConstants>CORERT_NO_REFLECTION;$(DefineConstants)</DefineConstants>
  </PropertyGroup>

</Project>
