forked from microsoft/terminal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automatically generate an SxS manifest for WindowsTerminal's winmds (m…
…icrosoft#2043) Fixes microsoft#1987.
- Loading branch information
Showing
3 changed files
with
43 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project DefaultTargets="Build" ToolsVersion="16.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<BeforeLinkTargets Condition="'$(WindowsTargetPlatformVersion)' >= '10.0.18362.0'"> | ||
$(BeforeLinkTargets); | ||
_ConsoleGenerateAdditionalWinmdManifests; | ||
</BeforeLinkTargets> | ||
</PropertyGroup> | ||
|
||
<Target Name="_ConsoleMapWinmdsToManifestFiles" DependsOnTargets="ResolveAssemblyReferences"> | ||
<ItemGroup> | ||
<!-- For each non-system .winmd file in References, generate a .manifest in IntDir for it. --> | ||
<_ConsoleWinmdManifest Include="@(ReferencePath->'$(IntDir)\%(FileName).manifest')" Condition="'%(ReferencePath.IsSystemReference)' != 'true' and '%(ReferencePath.WinMDFile)' == 'true' and '%(ReferencePath.ReferenceSourceTarget)' == 'ResolveAssemblyReference'"> | ||
<WinMDPath>%(ReferencePath.FullPath)</WinMDPath> | ||
<Implementation>%(ReferencePath.Implementation)</Implementation> | ||
</_ConsoleWinmdManifest> | ||
<!-- For each referenced project that _produces_ a winmd, generate a temporary item that maps to | ||
the winmd, and use that temporary item to generate a .manifest in IntDir for it. | ||
We don't set Implementation here because it's inherited from the _ResolvedNativeProjectReferencePaths. --> | ||
<_ConsoleWinmdProjectReference Condition="'%(_ResolvedNativeProjectReferencePaths.ProjectType)' != 'StaticLibrary'" Include="@(_ResolvedNativeProjectReferencePaths->WithMetadataValue('FileType','winmd')->'%(RootDir)%(Directory)%(TargetPath)')" /> | ||
<_ConsoleWinmdManifest Include="@(_ConsoleWinmdProjectReference->'$(IntDir)\%(FileName).manifest')"> | ||
<WinMDPath>%(Identity)</WinMDPath> | ||
</_ConsoleWinmdManifest> | ||
</ItemGroup> | ||
</Target> | ||
|
||
<Target Name="_ConsoleGenerateAdditionalWinmdManifests" | ||
Inputs="@(_ConsoleWinmdManifest.WinMDPath)" | ||
Outputs="@(_ConsoleWinmdManifest)" | ||
DependsOnTargets="_ConsoleMapWinmdsToManifestFiles"> | ||
|
||
<!-- This target is batched and a new Exec is spawned for each entry in _ConsoleWinmdManifest. --> | ||
<Exec Command="mt.exe -winmd:%(_ConsoleWinmdManifest.WinMDPath) -dll:%(_ConsoleWinmdManifest.Implementation) -out:%(_ConsoleWinmdManifest.Identity)" /> | ||
|
||
<ItemGroup> | ||
<!-- Emit the generated manifest into the Link inputs. --> | ||
<Manifest Include="@(_ConsoleWinmdManifest)" /> | ||
</ItemGroup> | ||
|
||
</Target> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters