Skip to content

Commit cbe9659

Browse files
authored
Merge pull request #390 from jlaanstra/user/jlaans/xaml-targets
The CppWinRTAddXamlReferences/CppWinRTSetXamlLocalAssembly targets should only execute if the xaml language is CppWinRT.
2 parents 5c80b6d + 54d1d38 commit cbe9659

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

nuget/Microsoft.Windows.CppWinRT.targets

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,15 +523,19 @@ $(XamlMetaDataProviderPch)
523523
<Target Name="CppWinRTMakeProjections" DependsOnTargets="CppWinRTCalculateEnabledProjections;CppWinRTMakePlatformProjection;CppWinRTMakeReferenceProjection;CppWinRTMakeComponentProjection;$(CppWinRTMakeProjectionsDependsOn)" />
524524

525525
<!--Add references to all merged project WinMD files for Xaml Compiler-->
526-
<Target Name="CppWinRTAddXamlReferences" DependsOnTargets="$(CppWinRTAddXamlReferencesDependsOn)">
526+
<Target Name="CppWinRTAddXamlReferences"
527+
Condition="'@(Page)@(ApplicationDefinition)' != '' and '$(XamlLanguage)' == 'CppWinRT'"
528+
DependsOnTargets="$(CppWinRTAddXamlReferencesDependsOn)">
527529
<ItemGroup>
528530
<XamlReferencesToCompile Include="$(OutDir)*.winmd" />
529531
</ItemGroup>
530532
</Target>
531533

532534
<!--Clear merged assembly and set local assembly for Xaml Compiler.
533535
(Note: this can be removed when CppWinRT references are removed from the Xaml targets file.)-->
534-
<Target Name="CppWinRTSetXamlLocalAssembly" DependsOnTargets="$(CppWinRTSetXamlLocalAssemblyDependsOn)">
536+
<Target Name="CppWinRTSetXamlLocalAssembly"
537+
Condition="'@(Page)@(ApplicationDefinition)' != '' and '$(XamlLanguage)' == 'CppWinRT'"
538+
DependsOnTargets="$(CppWinRTSetXamlLocalAssemblyDependsOn)">
535539
<PropertyGroup>
536540
<CppWinRTMetadataAssembly></CppWinRTMetadataAssembly>
537541
<XamlLocalAssembly>$(CppWinRTProjectWinMD)</XamlLocalAssembly>

0 commit comments

Comments
 (0)