From a185a6fdbdba3eaca44f869ebc3120e1cda46531 Mon Sep 17 00:00:00 2001 From: Johan Laanstra Date: Fri, 6 Dec 2019 21:17:41 -0800 Subject: [PATCH 1/4] Ensure we update the response files when the targets are run. --- nuget/Microsoft.Windows.CppWinRT.targets | 95 +++++++++++------------- 1 file changed, 42 insertions(+), 53 deletions(-) diff --git a/nuget/Microsoft.Windows.CppWinRT.targets b/nuget/Microsoft.Windows.CppWinRT.targets index ee0ec5e16..246129a43 100644 --- a/nuget/Microsoft.Windows.CppWinRT.targets +++ b/nuget/Microsoft.Windows.CppWinRT.targets @@ -88,6 +88,13 @@ Copyright (C) Microsoft Corporation. All rights reserved. false + + + $(WindowsSDK_MetadataFoundationPath);%(AdditionalMetadataDirectories) + $(WindowsSDK_MetadataPath);%(AdditionalMetadataDirectories) + + + <_CppWinRT_RS4OrGreater>false @@ -121,19 +128,19 @@ Copyright (C) Microsoft Corporation. All rights reserved. - + true true - + false - + - $([System.IO.Path]::GetFileName('%(Link.WindowsMetadataFile)')) true @@ -172,7 +179,7 @@ Copyright (C) Microsoft Corporation. All rights reserved. true $(ConfigurationType) - + @@ -351,16 +358,16 @@ Copyright (C) Microsoft Corporation. All rights reserved. [$(XamlNamespace).Markup.FullXamlMetadataProvider] import "$(XamlNamespace).Markup.idl"%3b -// This file is generated by the build to support Xaml apps -$(XamlMarkupIdlImport) -namespace $(RootNamespace) -{ - $(FullXamlMetadataProviderAttribute)runtimeclass XamlMetaDataProvider : [default] $(XamlNamespace).Markup.IXamlMetadataProvider - { - XamlMetaDataProvider()%3b - } -} - + // This file is generated by the build to support Xaml apps + $(XamlMarkupIdlImport) + namespace $(RootNamespace) + { + $(FullXamlMetadataProviderAttribute)runtimeclass XamlMetaDataProvider : [default] $(XamlNamespace).Markup.IXamlMetadataProvider + { + XamlMetaDataProvider()%3b + } + } + @(ClCompile->Metadata('PrecompiledHeaderFile')->Distinct()) #include "$(_PCH)" -// This file is generated by the build to support Xaml apps -$(XamlMetaDataProviderPch) -#include "XamlMetaDataProvider.h" -#include "XamlMetaDataProvider.g.cpp" - + // This file is generated by the build to support Xaml apps + $(XamlMetaDataProviderPch) + #include "XamlMetaDataProvider.h" + #include "XamlMetaDataProvider.g.cpp" + - + Condition="'$(CppWinRTModernIDL)' != 'false'" + DependsOnTargets="GetCppWinRTPlatformWinMDReferences;GetCppWinRTDirectWinMDReferences;GetCppWinRTProjectWinMDReferences;$(CppWinRTSetMidlReferencesDependsOn)" + Inputs="@(CppWinRTDirectWinMDReferences);@(CppWinRTStaticProjectWinMDReferences);@(CppWinRTDynamicProjectWinMDReferences);@(CppWinRTPlatformWinMDReferences)" + Outputs="$(IntDir)midlrt.rsp"> + <_MidlReferences Remove="@(_MidlReferences)"/> <_MidlReferences Include="@(CppWinRTDirectWinMDReferences)"/> <_MidlReferences Include="@(CppWinRTStaticProjectWinMDReferences)"/> @@ -408,22 +418,13 @@ $(XamlMetaDataProviderPch) %(Midl.AdditionalOptions) %40"$(IntDir)midlrt.rsp" - - - %(Midl.AdditionalMetadataDirectories);$(WindowsSDK_MetadataFoundationPath); - %(Midl.AdditionalMetadataDirectories);$(WindowsSDK_MetadataPath); - - <_MidlrtParameters>@(_MidlReferencesDistinct->'/reference "%(WinMDPath)"',' ') - + - @@ -449,13 +450,10 @@ $(XamlMetaDataProviderPch) <_MdMergeParameters>$(_MdMergeParameters) @(CppWinRTMdMergeInputs->'-i "%(Identity)"', ' ') <_MdMergeParameters>$(_MdMergeParameters) -o "$(CppWinRTMergedDir.TrimEnd('\'))" -partial $(_MdMergeDepth) - + - @@ -498,13 +496,10 @@ $(XamlMetaDataProviderPch) <_CppwinrtParameters>$(_CppwinrtParameters) @(_CppwinrtInputs->'-in "%(WinMDPath)"', ' ') <_CppwinrtParameters>$(_CppwinrtParameters) -out "$(GeneratedFilesDir)." - + - @@ -532,13 +527,10 @@ $(XamlMetaDataProviderPch) <_CppwinrtParameters>$(_CppwinrtParameters) @(_CppwinrtRefRefs->'-ref "%(WinMDPath)"', ' ') <_CppwinrtParameters>$(_CppwinrtParameters) -out "$(GeneratedFilesDir)." - + - @@ -590,13 +582,10 @@ $(XamlMetaDataProviderPch) <_CppwinrtParameters>$(_CppwinrtParameters) @(_CppwinrtCompRefs->'-ref "%(WinMDPath)"', ' ') <_CppwinrtParameters>$(_CppwinrtParameters) -out "$(GeneratedFilesDir)." - + - From 428cf8e35ef7117cb3158059f806dd5e39d78569 Mon Sep 17 00:00:00 2001 From: Johan Laanstra Date: Fri, 6 Dec 2019 21:21:13 -0800 Subject: [PATCH 2/4] Fix formatting. --- nuget/Microsoft.Windows.CppWinRT.targets | 30 ++++++++++++------------ 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/nuget/Microsoft.Windows.CppWinRT.targets b/nuget/Microsoft.Windows.CppWinRT.targets index 246129a43..6f9c19552 100644 --- a/nuget/Microsoft.Windows.CppWinRT.targets +++ b/nuget/Microsoft.Windows.CppWinRT.targets @@ -358,16 +358,16 @@ Copyright (C) Microsoft Corporation. All rights reserved. [$(XamlNamespace).Markup.FullXamlMetadataProvider] import "$(XamlNamespace).Markup.idl"%3b - // This file is generated by the build to support Xaml apps - $(XamlMarkupIdlImport) - namespace $(RootNamespace) - { - $(FullXamlMetadataProviderAttribute)runtimeclass XamlMetaDataProvider : [default] $(XamlNamespace).Markup.IXamlMetadataProvider - { - XamlMetaDataProvider()%3b - } - } - +// This file is generated by the build to support Xaml apps +$(XamlMarkupIdlImport) +namespace $(RootNamespace) +{ + $(FullXamlMetadataProviderAttribute)runtimeclass XamlMetaDataProvider : [default] $(XamlNamespace).Markup.IXamlMetadataProvider + { + XamlMetaDataProvider()%3b + } +} + @(ClCompile->Metadata('PrecompiledHeaderFile')->Distinct()) #include "$(_PCH)" - // This file is generated by the build to support Xaml apps - $(XamlMetaDataProviderPch) - #include "XamlMetaDataProvider.h" - #include "XamlMetaDataProvider.g.cpp" - +// This file is generated by the build to support Xaml apps +$(XamlMetaDataProviderPch) +#include "XamlMetaDataProvider.h" +#include "XamlMetaDataProvider.g.cpp" + Date: Mon, 9 Dec 2019 20:41:39 -0800 Subject: [PATCH 3/4] Add $(MSBuildAllProjects); to a few places where it makes sense. --- nuget/Microsoft.Windows.CppWinRT.props | 4 ++++ nuget/Microsoft.Windows.CppWinRT.targets | 14 +++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/nuget/Microsoft.Windows.CppWinRT.props b/nuget/Microsoft.Windows.CppWinRT.props index c5dcee231..8f6175e25 100644 --- a/nuget/Microsoft.Windows.CppWinRT.props +++ b/nuget/Microsoft.Windows.CppWinRT.props @@ -6,6 +6,10 @@ Copyright (C) Microsoft Corporation. All rights reserved. + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + x64 true diff --git a/nuget/Microsoft.Windows.CppWinRT.targets b/nuget/Microsoft.Windows.CppWinRT.targets index 6f9c19552..f22ae3cf1 100644 --- a/nuget/Microsoft.Windows.CppWinRT.targets +++ b/nuget/Microsoft.Windows.CppWinRT.targets @@ -5,6 +5,10 @@ Copyright (C) Microsoft Corporation. All rights reserved. --> + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + normal -verbose @@ -404,7 +408,7 @@ $(XamlMetaDataProviderPch) <_MidlReferences Remove="@(_MidlReferences)"/> @@ -434,7 +438,7 @@ $(XamlMetaDataProviderPch) @@ -482,7 +486,7 @@ $(XamlMetaDataProviderPch) $(CppWinRTPath)cppwinrt %40"$(IntDir)cppwinrt_plat.rsp" @@ -509,7 +513,7 @@ $(XamlMetaDataProviderPch) $(CppWinRTPath)cppwinrt %40"$(IntDir)cppwinrt_ref.rsp" @@ -540,7 +544,7 @@ $(XamlMetaDataProviderPch) <_PCH>@(ClCompile->Metadata('PrecompiledHeaderFile')->Distinct()) From b415ddf3d31e1b8eb0e07c33b5f4e5cf546e18fc Mon Sep 17 00:00:00 2001 From: Johan Laanstra Date: Wed, 11 Dec 2019 14:26:21 -0800 Subject: [PATCH 4/4] Add condition. --- nuget/Microsoft.Windows.CppWinRT.props | 4 +++- nuget/Microsoft.Windows.CppWinRT.targets | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/nuget/Microsoft.Windows.CppWinRT.props b/nuget/Microsoft.Windows.CppWinRT.props index 8f6175e25..9401bc8a7 100644 --- a/nuget/Microsoft.Windows.CppWinRT.props +++ b/nuget/Microsoft.Windows.CppWinRT.props @@ -7,7 +7,9 @@ Copyright (C) Microsoft Corporation. All rights reserved. - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) diff --git a/nuget/Microsoft.Windows.CppWinRT.targets b/nuget/Microsoft.Windows.CppWinRT.targets index f22ae3cf1..e991b3ea7 100644 --- a/nuget/Microsoft.Windows.CppWinRT.targets +++ b/nuget/Microsoft.Windows.CppWinRT.targets @@ -6,7 +6,9 @@ Copyright (C) Microsoft Corporation. All rights reserved. - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath)