mirror of
https://github.com/microsoft/terminal.git
synced 2026-04-08 05:00:24 -04:00
We originally needed this library (or a separate DLL in our own project) to handle hooking up the XAML resource loader to the providers that our application needed. It was introduced in its nascent form in 2019, in a PR titled "Make XAML files work." It appears we no longer need it, and the provider hookup is being handled by our `AppT2` base class override. I've tested this in Windows 10 Vb running unpackaged, and it seems to work totally fine. Crazy. Removing this dependency saves us a couple hundred kilobytes on disk and removes one consumer of the App CRT from our package.
189 lines
9.2 KiB
XML
189 lines
9.2 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
<PropertyGroup Label="Globals">
|
|
<ProjectGuid>{a4394404-37f7-41c1-802b-49788d3720e3}</ProjectGuid>
|
|
<Keyword>Win32Proj</Keyword>
|
|
<RootNamespace>SampleApp</RootNamespace>
|
|
<ProjectName>SampleAppLib</ProjectName>
|
|
<TargetName>SampleAppLib</TargetName>
|
|
<ConfigurationType>StaticLibrary</ConfigurationType>
|
|
<SubSystem>Console</SubSystem>
|
|
<OpenConsoleUniversalApp>true</OpenConsoleUniversalApp>
|
|
<!--
|
|
This is an override that, puzzlingly, _forces XBF (XAML binary) embedding_.
|
|
We have to do this to overcome a layout issue in the WAP packaging project.
|
|
When we do this, the XBF ends up in resources.pri.
|
|
-->
|
|
<DisableEmbeddedXbf>false</DisableEmbeddedXbf>
|
|
<XamlComponentResourceLocation>nested</XamlComponentResourceLocation>
|
|
</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" />
|
|
|
|
<!-- ========================= XAML files ======================== -->
|
|
<ItemGroup>
|
|
<!-- HERE BE DRAGONS:
|
|
For any types that use XAML information, if their .idl and .h aren't
|
|
marked DependentUpon the corresponding .xaml file, XamlTypeInfo.g.h won't
|
|
pick it up correctly. -->
|
|
<ApplicationDefinition Include="App.xaml">
|
|
<SubType>Designer</SubType>
|
|
</ApplicationDefinition>
|
|
</ItemGroup>
|
|
<!-- When we add other user controls, they should go in here as so: -->
|
|
<ItemGroup>
|
|
<Page Include="MyPage.xaml">
|
|
<SubType>Designer</SubType>
|
|
</Page>
|
|
</ItemGroup>
|
|
<!-- ========================= Headers ======================== -->
|
|
<ItemGroup>
|
|
<ClInclude Include="App.base.h" />
|
|
<ClInclude Include="MySettings.h" />
|
|
<ClInclude Include="MyPage.h">
|
|
<DependentUpon>MyPage.xaml</DependentUpon>
|
|
<SubType>Code</SubType>
|
|
</ClInclude>
|
|
<ClInclude Include="App.h">
|
|
<DependentUpon>App.xaml</DependentUpon>
|
|
</ClInclude>
|
|
<ClInclude Include="SampleAppLogic.h">
|
|
<DependentUpon>SampleAppLogic.idl</DependentUpon>
|
|
</ClInclude>
|
|
</ItemGroup>
|
|
<!-- ========================= Cpp Files ======================== -->
|
|
<ItemGroup>
|
|
<ClCompile Include="init.cpp" />
|
|
<ClCompile Include="MySettings.cpp" />
|
|
<ClCompile Include="MyPage.cpp">
|
|
<DependentUpon>MyPage.xaml</DependentUpon>
|
|
<SubType>Code</SubType>
|
|
</ClCompile>
|
|
<ClCompile Include="pch.cpp">
|
|
<PrecompiledHeader>Create</PrecompiledHeader>
|
|
</ClCompile>
|
|
<ClCompile Include="App.cpp">
|
|
<DependentUpon>App.xaml</DependentUpon>
|
|
</ClCompile>
|
|
<ClCompile Include="SampleAppLogic.cpp">
|
|
<DependentUpon>SampleAppLogic.idl</DependentUpon>
|
|
</ClCompile>
|
|
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
|
|
|
|
</ItemGroup>
|
|
<!-- ========================= idl Files ======================== -->
|
|
<ItemGroup>
|
|
<!-- If you add idl files here, make sure to include their implementation's
|
|
header in SampleApp.vcxproj (as well as in this file) -->
|
|
<Midl Include="App.idl">
|
|
<DependentUpon>App.xaml</DependentUpon>
|
|
</Midl>
|
|
<Midl Include="SampleAppLogic.idl" />
|
|
<Midl Include="MySettings.idl" />
|
|
<Midl Include="MyPage.idl">
|
|
<DependentUpon>MyPage.xaml</DependentUpon>
|
|
<SubType>Code</SubType>
|
|
</Midl>
|
|
</ItemGroup>
|
|
<!-- ========================= Misc Files ======================== -->
|
|
<ItemGroup>
|
|
<PRIResource Include="Resources\en-US\Resources.resw" />
|
|
<OCResourceDirectory Include="Resources" />
|
|
<None Include="packages.config" />
|
|
</ItemGroup>
|
|
<!-- ========================= Project References ======================== -->
|
|
<PropertyGroup>
|
|
<!-- This is a hack to get the ARM64 CI build working. See
|
|
https://github.com/Microsoft/msbuild/issues/3746 - it looks like MsBuild
|
|
just has a bug in it.-->
|
|
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>Warning</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
|
|
</PropertyGroup>
|
|
<!-- ========================== Other References ========================= -->
|
|
<ItemGroup>
|
|
<!-- Manually add references to each of our dependent winmds. Mark them as
|
|
private=false and CopyLocalSatelliteAssemblies=false, so that we don't
|
|
propagate them upwards (which can make referencing this project result in
|
|
duplicate type definitions)-->
|
|
<Reference Include="Microsoft.Terminal.Core">
|
|
<HintPath>$(OpenConsoleCommonOutDir)TerminalCore\Microsoft.Terminal.Core.winmd</HintPath>
|
|
<IsWinMDFile>true</IsWinMDFile>
|
|
<Private>false</Private>
|
|
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
|
</Reference>
|
|
<Reference Include="Microsoft.Terminal.TerminalConnection">
|
|
<HintPath>$(OpenConsoleCommonOutDir)TerminalConnection\Microsoft.Terminal.TerminalConnection.winmd</HintPath>
|
|
<IsWinMDFile>true</IsWinMDFile>
|
|
<Private>false</Private>
|
|
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
|
</Reference>
|
|
<Reference Include="Microsoft.Terminal.Control">
|
|
<HintPath>$(OpenConsoleCommonOutDir)Microsoft.Terminal.Control\Microsoft.Terminal.Control.winmd</HintPath>
|
|
<IsWinMDFile>true</IsWinMDFile>
|
|
<Private>false</Private>
|
|
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
|
</Reference>
|
|
|
|
<Reference Include="$(WindowsSDK_MetadataPathVersioned)\Windows.UI.Xaml.Hosting.HostingContract\*\*.winmd">
|
|
<WinMDFile>true</WinMDFile>
|
|
<CopyLocal>false</CopyLocal>
|
|
<ReferenceGrouping>$(TargetPlatformMoniker)</ReferenceGrouping>
|
|
<ReferenceGroupingDisplayName>$(TargetPlatformDisplayName)</ReferenceGroupingDisplayName>
|
|
<ResolvedFrom>CppWinRTImplicitlyExpandTargetPlatform</ResolvedFrom>
|
|
<IsSystemReference>True</IsSystemReference>
|
|
</Reference>
|
|
|
|
</ItemGroup>
|
|
<!-- ====================== Compiler & Linker Flags ===================== -->
|
|
<ItemDefinitionGroup>
|
|
<ClCompile>
|
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
|
<AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories);</AdditionalIncludeDirectories>
|
|
<!-- Manually disable unreachable code warning, because jconcpp has a ton of that. -->
|
|
<DisableSpecificWarnings>4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
|
</ClCompile>
|
|
<Link>
|
|
<AdditionalDependencies>$(OpenConsoleCommonOutDir)\ConTypes.lib;WindowsApp.lib;shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
|
</Link>
|
|
</ItemDefinitionGroup>
|
|
<!-- ========================= Globals ======================== -->
|
|
<Import Project="$(OpenConsoleDir)src\cppwinrt.build.post.props" />
|
|
|
|
<!-- This -must- go after cppwinrt.build.post.props because that includes many VS-provided props including appcontainer.common.props, which stomps on what cppwinrt.targets did. -->
|
|
<Import Project="$(OpenConsoleDir)src\common.nugetversions.targets" />
|
|
|
|
<Import Project="$(OpenConsoleDir)packages\Microsoft.UI.Xaml.2.7.3\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('$(OpenConsoleDir)packages\Microsoft.UI.Xaml.2.7.3\build\native\Microsoft.UI.Xaml.targets')" />
|
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
|
<PropertyGroup>
|
|
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
|
</PropertyGroup>
|
|
<Error Condition="!Exists('$(OpenConsoleDir)packages\Microsoft.UI.Xaml.2.7.3\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.7.3\build\native\Microsoft.UI.Xaml.targets'))" />
|
|
</Target>
|
|
|
|
<!--
|
|
By default, the PRI file will contain resource paths beginning with the
|
|
project name. Since we enabled XBF embedding, this *also* includes App.xbf.
|
|
Well, App.xbf is hard-coded by the framework to be found at the resource ROOT.
|
|
To make that happen, we have to disable the prepending of the project name
|
|
to the App xaml files.
|
|
-->
|
|
<PropertyGroup>
|
|
<_GenerateProjectPriFileDependsOn>OpenConsolePlaceAppXbfAtRootOfResourceTree;$(_GenerateProjectPriFileDependsOn)</_GenerateProjectPriFileDependsOn>
|
|
</PropertyGroup>
|
|
<Target Name="OpenConsolePlaceAppXbfAtRootOfResourceTree" DependsOnTargets="GetPackagingOutputs">
|
|
<ItemGroup>
|
|
<_RelocatedAppXamlData Include="@(PackagingOutputs)" Condition="'%(Filename)' == 'App' and ('%(Extension)' == '.xaml' or '%(Extension)' == '.xbf')" />
|
|
<PackagingOutputs Remove="@(_RelocatedAppXamlData)" />
|
|
<PackagingOutputs Include="@(_RelocatedAppXamlData)">
|
|
<TargetPath>%(Filename)%(Extension)</TargetPath>
|
|
</PackagingOutputs>
|
|
</ItemGroup>
|
|
</Target>
|
|
|
|
<Import Project="$(SolutionDir)build\rules\CollectWildcardResources.targets" />
|
|
</Project>
|