Skip to content

Commit 0242fab

Browse files
authored
Return the full path to the generated WinMD. (#824)
1 parent 7b109f4 commit 0242fab

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

nuget/Microsoft.Windows.CppWinRT.targets

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,10 @@ Copyright (C) Microsoft Corporation. All rights reserved.
247247

248248
<!-- Add C++/WinRT primary WinMD to the WinMDFullPath if CppWinRTGenerateWindowsMetadata is true -->
249249
<ItemGroup>
250-
<WinMDFullPath Include="$(CppWinRTProjectWinMD)" Condition="'$(CppWinRTGenerateWindowsMetadata)' == 'true'">
250+
<!-- Create ItemGroup to evaluate FullPath -->
251+
<_CppWinRTProjectWinMDItems Include="$(CppWinRTProjectWinMD)" />
252+
253+
<WinMDFullPath Include="@(_CppWinRTProjectWinMDItems->FullPath()->Distinct()->ClearMetadata())" Condition="'$(CppWinRTGenerateWindowsMetadata)' == 'true'">
251254
<TargetPath>$([System.IO.Path]::GetFileName('$(CppWinRTProjectWinMD)'))</TargetPath>
252255
<Primary>true</Primary>
253256
<Implementation Condition="'$(TargetExt)' == '.dll'">$(WinMDImplementationPath)$(TargetName)$(TargetExt)</Implementation>
@@ -256,6 +259,8 @@ Copyright (C) Microsoft Corporation. All rights reserved.
256259
<ProjectName>$(MSBuildProjectName)</ProjectName>
257260
<ProjectType>$(ConfigurationType)</ProjectType>
258261
</WinMDFullPath>
262+
263+
<_CppWinRTProjectWinMDItems Remove="$(CppWinRTProjectWinMD)" />
259264
</ItemGroup>
260265

261266
<Message Text="GetResolvedWinMD: @(WinMDFullPath->'%(FullPath)')" Importance="$(CppWinRTVerbosity)"/>

0 commit comments

Comments
 (0)