Skip to content

Commit 5ffa6d9

Browse files
authored
Use the CppWinRTPlatformWinMDReferences itemgroup as the input for the platform projection. (#774)
1 parent ed1079a commit 5ffa6d9

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

nuget/Microsoft.Windows.CppWinRT.targets

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,11 +226,11 @@ Copyright (C) Microsoft Corporation. All rights reserved.
226226

227227
<!--Define platform projection WinMD inputs-->
228228
<Target Name="GetCppWinRTPlatformWinMDInputs"
229-
DependsOnTargets="ResolveAssemblyReferences"
229+
DependsOnTargets="ResolveAssemblyReferences;GetCppWinRTPlatformWinMDReferences"
230230
Returns="@(CppWinRTPlatformWinMDInputs)">
231231
<ItemGroup>
232232
<_CppWinRTPlatformWinMDInputs Remove="@(_CppWinRTPlatformWinMDInputs)" />
233-
<_CppWinRTPlatformWinMDInputs Include="$(WindowsSDK_MetadataPathVersioned)\**\*.winmd" />
233+
<_CppWinRTPlatformWinMDInputs Include="@(CppWinRTPlatformWinMDReferences)" />
234234
<CppWinRTPlatformWinMDInputs Include="@(_CppWinRTPlatformWinMDInputs)">
235235
<WinMDPath>%(FullPath)</WinMDPath>
236236
</CppWinRTPlatformWinMDInputs>
@@ -245,10 +245,9 @@ Copyright (C) Microsoft Corporation. All rights reserved.
245245
<ItemGroup>
246246
<_CppWinRTPlatformWinMDReferences Remove="@(_CppWinRTPlatformWinMDReferences)" />
247247
<_CppWinRTPlatformWinMDReferences Include="@(ReferencePath)" Condition="'%(ReferencePath.IsSystemReference)' == 'true' and '%(ReferencePath.WinMDFile)' == 'true' and '%(ReferencePath.ReferenceSourceTarget)' == 'ResolveAssemblyReference'" />
248-
<_CppWinRTPlatformWinMDReferences Condition="'$(CppWinRTOverrideSDKReferences)' != 'true'" Include="$(WindowsSDK_MetadataPathVersioned)\**\Windows.Foundation.FoundationContract.winmd" />
249-
<_CppWinRTPlatformWinMDReferences Condition="'$(CppWinRTOverrideSDKReferences)' != 'true'" Include="$(WindowsSDK_MetadataPathVersioned)\**\Windows.Foundation.UniversalApiContract.winmd" />
250-
<_CppWinRTPlatformWinMDReferences Condition="'$(CppWinRTOverrideSDKReferences)' != 'true'" Include="$(WindowsSDK_MetadataPathVersioned)\**\Windows.Networking.Connectivity.WwanContract.winmd" />
251-
<_CppWinRTPlatformWinMDReferences Include="$(CppWinRTSDKReferences)" />
248+
<!-- Also include the winmds from the ImplicitlyExpandTargetPlatform target if it is enabled. -->
249+
<_CppWinRTPlatformWinMDReferences Include="@(ReferencePath)" Condition="'%(ReferencePath.IsSystemReference)' == 'true' and '%(ReferencePath.WinMDFile)' == 'true' and '%(ReferencePath.ResolvedFrom)' == 'ImplicitlyExpandTargetPlatform'" />
250+
<_CppWinRTPlatformWinMDReferences Include="$(CppWinRTSDKReferences)" />
252251
<CppWinRTPlatformWinMDReferences Remove="@(CppWinRTPlatformWinMDReferences)"/>
253252
<CppWinRTPlatformWinMDReferences Include="@(_CppWinRTPlatformWinMDReferences->'%(FullPath)'->Distinct())">
254253
<WinMDPath>%(FullPath)</WinMDPath>

0 commit comments

Comments
 (0)