From d8d5dc00759efd28c62cdec31bafb918a5493eb5 Mon Sep 17 00:00:00 2001 From: Johan Laanstra Date: Thu, 23 Mar 2023 10:20:14 -0700 Subject: [PATCH 1/2] Expose configuring /nomidl. --- nuget/Microsoft.Windows.CppWinRT.props | 1 + nuget/Microsoft.Windows.CppWinRT.targets | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/nuget/Microsoft.Windows.CppWinRT.props b/nuget/Microsoft.Windows.CppWinRT.props index d7e2c652c..e329a7461 100644 --- a/nuget/Microsoft.Windows.CppWinRT.props +++ b/nuget/Microsoft.Windows.CppWinRT.props @@ -43,6 +43,7 @@ Copyright (C) Microsoft Corporation. All rights reserved. nul nul + true @@ -475,8 +474,9 @@ $(XamlMetaDataProviderPch) <_MidlReferences Include="@(CppWinRTPlatformWinMDReferences)"/> <_MidlReferencesDistinct Remove="@(_MidlReferencesDistinct)" /> <_MidlReferencesDistinct Include="@(_MidlReferences->'%(WinMDPath)'->Distinct())" /> - - %(Midl.AdditionalOptions) %40"$(CppWinRTMidlResponseFile)" + + %(Midl.AdditionalOptions) /nomidl + %(Midl.AdditionalOptions) /nomidl %40"$(CppWinRTMidlResponseFile)" From bfd29fb6cc8385e82812ffc0e82bdc2d2489914f Mon Sep 17 00:00:00 2001 From: Johan Laanstra Date: Thu, 23 Mar 2023 14:54:18 -0700 Subject: [PATCH 2/2] Add test project and fix comments. --- nuget/Microsoft.Windows.CppWinRT.props | 2 +- nuget/Microsoft.Windows.CppWinRT.targets | 10 +- test/nuget/NuGetTest.sln | 22 ++- test/nuget/TestApp/TestApp.vcxproj | 3 + test/nuget/TestProxyStub/IAsyncContract.idl | 11 ++ .../TestProxyStub/IAsyncContractParameter.idl | 11 ++ test/nuget/TestProxyStub/TestProxyStub.def | 3 + .../nuget/TestProxyStub/TestProxyStub.vcxproj | 127 ++++++++++++++++++ test/nuget/TestProxyStub/pch.cpp | 1 + test/nuget/TestProxyStub/pch.h | 8 ++ 10 files changed, 191 insertions(+), 7 deletions(-) create mode 100644 test/nuget/TestProxyStub/IAsyncContract.idl create mode 100644 test/nuget/TestProxyStub/IAsyncContractParameter.idl create mode 100644 test/nuget/TestProxyStub/TestProxyStub.def create mode 100644 test/nuget/TestProxyStub/TestProxyStub.vcxproj create mode 100644 test/nuget/TestProxyStub/pch.cpp create mode 100644 test/nuget/TestProxyStub/pch.h diff --git a/nuget/Microsoft.Windows.CppWinRT.props b/nuget/Microsoft.Windows.CppWinRT.props index e329a7461..e1d9b4716 100644 --- a/nuget/Microsoft.Windows.CppWinRT.props +++ b/nuget/Microsoft.Windows.CppWinRT.props @@ -43,7 +43,7 @@ Copyright (C) Microsoft Corporation. All rights reserved. nul nul - true + true @@ -474,9 +475,11 @@ $(XamlMetaDataProviderPch) <_MidlReferences Include="@(CppWinRTPlatformWinMDReferences)"/> <_MidlReferencesDistinct Remove="@(_MidlReferencesDistinct)" /> <_MidlReferencesDistinct Include="@(_MidlReferences->'%(WinMDPath)'->Distinct())" /> - - %(Midl.AdditionalOptions) /nomidl - %(Midl.AdditionalOptions) /nomidl %40"$(CppWinRTMidlResponseFile)" + + %(Midl.AdditionalOptions) /nomidl + + + %(Midl.AdditionalOptions) %40"$(CppWinRTMidlResponseFile)" @@ -883,7 +886,6 @@ $(XamlMetaDataProviderPch) $(WindowsSDK_MetadataFoundationPath);%(AdditionalMetadataDirectories) $(WindowsSDK_MetadataPath);%(AdditionalMetadataDirectories) - %(AdditionalOptions) /nomidl %(AdditionalDependencies);WindowsApp.lib diff --git a/test/nuget/NuGetTest.sln b/test/nuget/NuGetTest.sln index 24b81d177..db32e2b61 100644 --- a/test/nuget/NuGetTest.sln +++ b/test/nuget/NuGetTest.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29025.244 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.33516.290 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestApp", "TestApp\TestApp.vcxproj", "{A8BDBDE9-1A3D-4F5E-8668-9F6E84790D44}" EndProject @@ -45,6 +45,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestStaticLibrary7", "TestS EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ConsoleApplication1", "ConsoleApplication1\ConsoleApplication1.vcxproj", "{4DD64EAE-4B27-415A-863E-55CB8D5863DD}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestProxyStub", "TestProxyStub\TestProxyStub.vcxproj", "{98E28FC8-2EB7-4544-9B6A-941462C6D3E2}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|ARM = Debug|ARM @@ -301,6 +303,22 @@ Global {4DD64EAE-4B27-415A-863E-55CB8D5863DD}.Release|x64.Build.0 = Release|x64 {4DD64EAE-4B27-415A-863E-55CB8D5863DD}.Release|x86.ActiveCfg = Release|Win32 {4DD64EAE-4B27-415A-863E-55CB8D5863DD}.Release|x86.Build.0 = Release|Win32 + {98E28FC8-2EB7-4544-9B6A-941462C6D3E2}.Debug|ARM.ActiveCfg = Debug|x64 + {98E28FC8-2EB7-4544-9B6A-941462C6D3E2}.Debug|ARM.Build.0 = Debug|x64 + {98E28FC8-2EB7-4544-9B6A-941462C6D3E2}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {98E28FC8-2EB7-4544-9B6A-941462C6D3E2}.Debug|ARM64.Build.0 = Debug|ARM64 + {98E28FC8-2EB7-4544-9B6A-941462C6D3E2}.Debug|x64.ActiveCfg = Debug|x64 + {98E28FC8-2EB7-4544-9B6A-941462C6D3E2}.Debug|x64.Build.0 = Debug|x64 + {98E28FC8-2EB7-4544-9B6A-941462C6D3E2}.Debug|x86.ActiveCfg = Debug|Win32 + {98E28FC8-2EB7-4544-9B6A-941462C6D3E2}.Debug|x86.Build.0 = Debug|Win32 + {98E28FC8-2EB7-4544-9B6A-941462C6D3E2}.Release|ARM.ActiveCfg = Release|x64 + {98E28FC8-2EB7-4544-9B6A-941462C6D3E2}.Release|ARM.Build.0 = Release|x64 + {98E28FC8-2EB7-4544-9B6A-941462C6D3E2}.Release|ARM64.ActiveCfg = Release|ARM64 + {98E28FC8-2EB7-4544-9B6A-941462C6D3E2}.Release|ARM64.Build.0 = Release|ARM64 + {98E28FC8-2EB7-4544-9B6A-941462C6D3E2}.Release|x64.ActiveCfg = Release|x64 + {98E28FC8-2EB7-4544-9B6A-941462C6D3E2}.Release|x64.Build.0 = Release|x64 + {98E28FC8-2EB7-4544-9B6A-941462C6D3E2}.Release|x86.ActiveCfg = Release|Win32 + {98E28FC8-2EB7-4544-9B6A-941462C6D3E2}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/test/nuget/TestApp/TestApp.vcxproj b/test/nuget/TestApp/TestApp.vcxproj index 5406ef28d..582b95103 100644 --- a/test/nuget/TestApp/TestApp.vcxproj +++ b/test/nuget/TestApp/TestApp.vcxproj @@ -143,6 +143,9 @@ + + {98E28FC8-2EB7-4544-9B6A-941462C6D3E2} + {e0ebbe54-c046-4611-b048-3ce893b1df8a} diff --git a/test/nuget/TestProxyStub/IAsyncContract.idl b/test/nuget/TestProxyStub/IAsyncContract.idl new file mode 100644 index 000000000..0a4ae04b4 --- /dev/null +++ b/test/nuget/TestProxyStub/IAsyncContract.idl @@ -0,0 +1,11 @@ +import "Windows.Foundation.idl"; +import "IAsyncContractParameter.idl"; + +namespace TestProxyStub +{ + [uuid("A388AC69-7C0F-4CCB-B108-E091BE3DAB88")] + interface IAsyncContract + { + Windows.Foundation.IAsyncAction RunAsync(IAsyncContractParameter parameter); + }; +} diff --git a/test/nuget/TestProxyStub/IAsyncContractParameter.idl b/test/nuget/TestProxyStub/IAsyncContractParameter.idl new file mode 100644 index 000000000..b6a3769c3 --- /dev/null +++ b/test/nuget/TestProxyStub/IAsyncContractParameter.idl @@ -0,0 +1,11 @@ +import "Windows.Foundation.idl"; + +namespace TestProxyStub +{ + [uuid("F219AC9A-9858-4F66-8DA7-47A9E08438AC")] + interface IAsyncContractParameter + { + String Name{ get; }; + Object Details{ get; }; + }; +} diff --git a/test/nuget/TestProxyStub/TestProxyStub.def b/test/nuget/TestProxyStub/TestProxyStub.def new file mode 100644 index 000000000..753f222d5 --- /dev/null +++ b/test/nuget/TestProxyStub/TestProxyStub.def @@ -0,0 +1,3 @@ +EXPORTS + DllCanUnloadNow PRIVATE + DllGetClassObject PRIVATE \ No newline at end of file diff --git a/test/nuget/TestProxyStub/TestProxyStub.vcxproj b/test/nuget/TestProxyStub/TestProxyStub.vcxproj new file mode 100644 index 000000000..899a5c11c --- /dev/null +++ b/test/nuget/TestProxyStub/TestProxyStub.vcxproj @@ -0,0 +1,127 @@ + + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + Debug + ARM64 + + + Release + ARM64 + + + + 16.0 + Win32Proj + {98E28FC8-2EB7-4544-9B6A-941462C6D3E2} + TestProxyStub + 10.0.22621.0 + 10.0.18362.0 + + false + false + + + + DynamicLibrary + v143 + Unicode + + + + + + + + + WIN32;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + Use + pch.h + %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory) + + + Windows + onecore.lib;onecoreuap.lib;%(AdditionalDependencies) + TestProxyStub.def + + + Stub + Stub + true + $(IntDir)dlldata.c + $(IntDir)%(FileName).h + $(IntDir)%(FileName)_i.c + $(IntDir)%(FileName)_p.c + $(WindowsSDK_UnionMetadataPath) + true + false + + + + + _DEBUG;%(PreprocessorDefinitions) + + + + + NDEBUG;%(PreprocessorDefinitions) + + + + + + + + + + + + NotUsing + + + NotUsing + + + NotUsing + + + NotUsing + + + NotUsing + + + Create + + + + + + + + false + + + false + + + + + \ No newline at end of file diff --git a/test/nuget/TestProxyStub/pch.cpp b/test/nuget/TestProxyStub/pch.cpp new file mode 100644 index 000000000..1d9f38c57 --- /dev/null +++ b/test/nuget/TestProxyStub/pch.cpp @@ -0,0 +1 @@ +#include "pch.h" diff --git a/test/nuget/TestProxyStub/pch.h b/test/nuget/TestProxyStub/pch.h new file mode 100644 index 000000000..3186dac74 --- /dev/null +++ b/test/nuget/TestProxyStub/pch.h @@ -0,0 +1,8 @@ +// +// pch.h +// Header for platform projection include files +// + +#pragma once + +#include