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

  <PropertyGroup>
    <OutputType>Library</OutputType>
    <VersionPrefix>0.12.0</VersionPrefix>
    <TargetFrameworks>netcoreapp3.0;netstandard2.1</TargetFrameworks>
    <LangVersion>8.0</LangVersion>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
  </PropertyGroup>

  <PropertyGroup>
    <Authors>Alex Barney</Authors>
    <Copyright>Copyright © 2018-2020 Alex Barney</Copyright>
    <Description>A library for reading content formats used by the Nintendo Switch.</Description>
    <PackageTags>Nintendo;Switch;nca;xci;savefile</PackageTags>
    <PackageProjectUrl>https://github.com/Thealexbarney/LibHac</PackageProjectUrl>
    <PackageLicenseExpression>MIT</PackageLicenseExpression>

    <IncludeSymbols>true</IncludeSymbols>
    <SymbolPackageFormat>snupkg</SymbolPackageFormat>
    <PublishRepositoryUrl>true</PublishRepositoryUrl>
    <EmbedUntrackedSources>true</EmbedUntrackedSources>
    <GenerateDocumentationFile>true</GenerateDocumentationFile>

    <!-- When doing a release build with a Git directory, SourceLink will set the SourceRoot needed for DeterministicSourcePaths -->
    <!-- Otherwise use a manually specified path -->
    <PathMap Condition=" '$(BuildType)' == 'Release' and '$(HasGitDir)' == 'false' ">$(MSBuildProjectDirectory)=C:/LibHac/</PathMap>
    <DeterministicSourcePaths Condition=" '$(BuildType)' == 'Release' and '$(HasGitDir)' == 'true' ">true</DeterministicSourcePaths>

    <NoWarn>$(NoWarn);1591;NU5105</NoWarn>
  </PropertyGroup>

  <PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.0' ">
    <DefineConstants>$(DefineConstants);HAS_INTRINSICS</DefineConstants>
  </PropertyGroup>

  <ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.1' ">
    <PackageReference Include="System.Memory" Version="4.5.3" />
  </ItemGroup>

  <ItemGroup>
    <Compile Condition="Exists('ResultNameResolver.Generated.cs')" Remove="ResultNameResolver.Archive.cs" />
    <Compile Condition="Exists('Common\Keys\DefaultKeySet.Generated.cs')" Remove="Common\Keys\DefaultKeySet.Empty.cs" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
    <PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="5.0.0-preview.7.20364.11" />
  </ItemGroup>

</Project>
