terminal/src/common.build.post.props
Michael Niksa ddcc06e911
Move project to app CRTs in preparation to run Universal (#3474)
* Change to use App CRT in preparation for universal.
* Try to make project build again by setting winconpty to static lib so it'll use the CRT inside TerminalConnection (or its other consumers) instead of linking its own.
* Remove test for conpty dll, it's a lib now. Add additional commentary on how CRT linking works for future reference. I'm sure this will come up again.
* use the _apiset variant until proven otherwise to match the existing one.
* Clarification in the comments for linking.
2019-11-08 14:09:39 -08:00

77 lines
3.8 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Natvis Include="$(SolutionDir)tools\ConsoleTypes.natvis" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ItemDefinitionGroup>
<!-- Definition the program database type has to come after Microsoft.Cpp.props or it will be
rewritten to /ZI (edit-and-continue) type every time. -->
<ClCompile>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<!--
There's a property that dictates which libraries are linked by default: MinimalCoreWin.
When it's enabled, only a sparing few libraries are injected into Link.AdditionalDependencies.
ARM/ARM64 set it to true, whereas x86/64 do not.
Because the rules check whether MinimalCoreWin is "true" or explicitly blank,
*AND* it being blank is used to determine whether to override it to _be_ "true", we can't actually
set it to something that'll disable it.
(cf. $(VCTargetsPath)/Microsoft.Cpp.CoreWin.props)
Re-inject some necessary libs when MinimalCoreWin has been enabled.
-->
<AdditionalDependencies Condition="'$(MinimalCoreWin)'=='true'">gdi32.lib;advapi32.lib;shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>onecoreuap_apiset.lib;onecore_apiset.lib;dwrite.lib;dxgi.lib;d2d1.lib;d3d11.lib;shcore.lib;uxtheme.lib;dwmapi.lib;winmm.lib;pathcch.lib;propsys.lib;uiautomationcore.lib;Shlwapi.lib;ntdll.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<!-- DLLs Only -->
<ItemDefinitionGroup Condition="'$(ConfigurationType)' == 'DynamicLibrary'">
<ClCompile>
<PreprocessorDefinitions>_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<!-- Static Libs Only -->
<ItemDefinitionGroup Condition="'$(ConfigurationType)' == 'StaticLibrary'">
<ClCompile>
<PreprocessorDefinitions>_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<!-- Exclude our dependencies from static analysis. CAExcludePath can only be
set after we've imported Microsoft.Cpp.targets -->
<PropertyGroup>
<CAExcludePath>$(SolutionDir)\dep\;$(CAExcludePath)</CAExcludePath>
</PropertyGroup>
<Target Name="_ComputePrecompToCleanUp">
<ItemGroup>
<PCHFileToClean Include="$(IntDir)\**\*.pch" />
<PCHFileToClean Include="$(IntDir)\**\precomp.obj" />
<_PCHFileToCleanWithTimestamp Include="@(PCHFileToClean)" Condition="'%(Identity)' != ''">
<LastWriteTime>$([System.IO.File]::GetLastWriteTime('%(Identity)'))</LastWriteTime>
</_PCHFileToCleanWithTimestamp>
</ItemGroup>
</Target>
<!-- Instead of outright deleting the PCHs, we want to trick the "project freshness detector" by
emitting empty files that look suspiciously like the PCHs it's expecting.
It's of utmost importance that their timestamps match up. -->
<Target Name="CleanUpPrecompForSmallCIAgents"
DependsOnTargets="_ComputePrecompToCleanUp"
AfterTargets="AfterBuild"
Condition="'$(AGENT_ID)' != '' and !$(ProjectName.Contains('TerminalApp'))">
<!-- We just need to keep *TerminalApp*'s PCHs because they get rebuilt more often. -->
<Delete Files="@(_PCHFileToCleanWithTimestamp)"/>
<Touch Files="@(_PCHFileToCleanWithTimestamp)" Time="%(LastWriteTime)" AlwaysCreate="true" />
<Message Text="PCH and Precomp object @(_PCHFileToCleanWithTimestamp) has been deleted for $(ProjectName)." />
</Target>
</Project>