<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <PropertyGroup Label="Globals">
    <ProjectGuid>{067F0A06-FCB7-472C-96E9-B03B54E8E18D}</ProjectGuid>
    <Keyword>Win32Proj</Keyword>
    <RootNamespace>TerminalAzBridge</RootNamespace>
    <ProjectName>TerminalAzBridge</ProjectName>
    <TargetName>TerminalAzBridge</TargetName>
    <ConfigurationType>Application</ConfigurationType>
    <OpenConsoleUniversalApp>false</OpenConsoleUniversalApp>
    <ApplicationType>Windows Store</ApplicationType>
    <TargetPlatformIdentifier>Windows</TargetPlatformIdentifier>
    <VersionInfoFileDescription>Windows Terminal Azure Cloud Shell Connector</VersionInfoFileDescription>
  </PropertyGroup>

  <PropertyGroup Label="NuGet Dependencies">
    <TerminalCppWinrt>true</TerminalCppWinrt>
  </PropertyGroup>

  <Import Project="..\..\..\common.openconsole.props" Condition="'$(OpenConsoleDir)'==''" />
  <Import Project="$(OpenConsoleDir)src\common.nugetversions.props" />
  <Import Project="$(OpenConsoleDir)src\cppwinrt.build.pre.props" />

  <PropertyGroup>
    <GenerateManifest>true</GenerateManifest>
    <EmbedManifest>true</EmbedManifest>
  </PropertyGroup>

  <!-- Source Files -->
  <ItemGroup>
    <ClInclude Include="pch.h" />
    <ClInclude Include="ConsoleInputReader.h" />
  </ItemGroup>
  <ItemGroup>
    <ClCompile Include="pch.cpp">
      <PrecompiledHeader>Create</PrecompiledHeader>
    </ClCompile>
    <ClCompile Include="main.cpp" />
    <ClCompile Include="ConsoleInputReader.cpp" />
  </ItemGroup>
  <!-- Dependencies -->
  <ItemGroup>
    <ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalConnection\TerminalConnection.vcxproj">
      <Project>{CA5CAD1A-C46D-4588-B1C0-40F31AE9100B}</Project>
    </ProjectReference>
    <ProjectReference Include="$(OpenConsoleDir)src\types\lib\types.vcxproj" />
  </ItemGroup>

  <!--
    This ItemGroup and the Globals PropertyGroup below it are required in order
    to enable F5 debugging for the unpackaged application
    -->
  <ItemGroup>
    <PropertyPageSchema Include="$(VCTargetsPath)$(LangID)\debugger_general.xml" />
    <PropertyPageSchema Include="$(VCTargetsPath)$(LangID)\debugger_local_windows.xml" />
  </ItemGroup>
  <PropertyGroup Label="Globals">
    <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
  </PropertyGroup>

  <Import Project="$(OpenConsoleDir)src\cppwinrt.build.post.props" />
  <Import Project="$(OpenConsoleDir)src\common.nugetversions.targets" />

  <!-- These have to come after post.props because the Cpp common targets will inexplicably overwrite them. -->
  <ItemDefinitionGroup>
    <ClCompile>
      <SDLCheck>true</SDLCheck>
    </ClCompile>
    <Link>
      <SubSystem>Console</SubSystem>
    </Link>
  </ItemDefinitionGroup>

  <!--
  BODGY

  The wapproj `GetResolvedWinMD` target tries to get a winmd from every cppwinrt
  executable we put in the package. But we DON'T produce a winmd. This makes the
  FastUpToDate check fail every time, and leads to the whole wapproj build
  running even if you're just f5'ing the package. EVEN AFTER A SUCCESSFUL BUILD.

  Setting GenerateWindowsMetadata=false is enough to tell the build system that
  we don't produce one, and get it off our backs.
  -->
  <ItemDefinitionGroup>
    <Link>
        <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
    </Link>
  </ItemDefinitionGroup>

  <Import Project="$(OpenConsoleDir)\build\rules\GenerateSxsManifestsFromWinmds.targets" />
</Project>
