提交 eb08d780 编写于 作者: V Vatsan Madhavan

Build DirectWriteForwarder and System.Printing.vcxproj using C++/CLI support in Dev164.p2.

Update CppCliHelper to supply only NuGet support - remove targets that did full-on .NET Core reference resolution for C++/CLI
上级 b6fd7a38
......@@ -111,6 +111,7 @@ $(PreparePackageAssetsDependsOn):
</ItemGroup>
-->
<CreateItem Include="$(OutDir)*.dll"
Exclude="@(FileNamesExcludedFromPackaging -> '$(OutDir)%(Filename)%(Extension)' )"
AdditionalMetadata="RelativePath=$(ArtifactsPackagingDir)$(NormalizedPackageName)\$(DestinationSubFolder)"
Condition="'$(DestinationSubFolder)'!='' and '$(IsPackagingProject)'!='true' and '@(PackagingAssemblyContent)'==''">
<Output ItemName="PackageAsset" TaskParameter="Include"/>
......@@ -123,17 +124,20 @@ $(PreparePackageAssetsDependsOn):
</PropertyGroup>
-->
<CreateItem Include="$(OutDir)*.lib"
Exclude="@(FileNamesExcludedFromPackaging -> '$(OutDir)%(Filename)%(Extension)' )"
AdditionalMetadata="RelativePath=$(ArtifactsPackagingDir)$(NormalizedPackageName)\$(DestinationSubFolder)"
Condition="'$(DestinationSubFolder)'!='' and '$(IsPackagingProject)'!='true' and '@(PackagingAssemblyContent)'=='' and '$(IncludeLibFilesInPackaging)' == 'true'">
<Output ItemName="PackageAsset" TaskParameter="Include"/>
</CreateItem>
<CreateItem Include="$(OutDir)*.exe"
Exclude="@(FileNamesExcludedFromPackaging -> '$(OutDir)%(Filename)%(Extension)' )"
AdditionalMetadata="RelativePath=$(ArtifactsPackagingDir)$(NormalizedPackageName)\$(DestinationSubFolder)"
Condition="'$(DestinationSubFolder)'!='' and '$(IsPackagingProject)'!='true' and '@(PackagingAssemblyContent)'==''">
<Output ItemName="PackageAsset" TaskParameter="Include"/>
</CreateItem>
<CreateItem Include="$(OutDir)*.pdb"
Exclude="@(FileNamesExcludedFromPackaging -> '$(OutDir)%(Filename)%(Extension)' )"
AdditionalMetadata="RelativePath=$(ArtifactsPackagingDir)$(NormalizedPackageName)\$(DestinationSubFolder)"
Condition="'$(DestinationSubFolder)'!='' and '$(IsPackagingProject)'!='true' and '$(ExcludePdbs)'!='true' and '@(PackagingAssemblyContent)'==''">
<Output ItemName="PackageAsset" TaskParameter="Include"/>
......
......@@ -49,6 +49,22 @@
<ManagedCxx Condition="'$(CLRSupport)'=='true'">true</ManagedCxx>
<ManagedCxx Condition="'$(CLRSupport)'=='pure'">true</ManagedCxx>
</PropertyGroup>
<!--
Enable IDE support for C++/CLI .NET Core builds
-->
<PropertyGroup>
<CLRSupport Condition="'$(CLRSupport)' == 'pure'">NetCore</CLRSupport>
</PropertyGroup>
<!--
When building C++/CLI..
... Disable C# CoreGenerateSatelliteAssemblies target
-->
<PropertyGroup Condition="'$(ManagedCxx)' == 'true'">
<GenerateSatelliteAssembliesForCore>false</GenerateSatelliteAssembliesForCore>
</PropertyGroup>
<PropertyGroup Condition="'$(ManagedCxx)' == 'true'">
<!-- This is usually set by the Microsoft.NETFramework.CurrentVersion.props file,
......@@ -149,7 +165,7 @@
linking to a privatized copy of vcruntime140d.dll here. Such build should simply copy over the debug version of vcruntime DLL's
to the appropriate location for testing purposes.
-->
<DllRenameClause Condition="('$(UseStaticVCRT)'!='true' or '$(CLRSupport)'=='pure') And '$(Configuration)'=='Release'">/dllrename:$(VCRuntimeDllBaseName)$(VCRuntimeVersion)$(LibSuffix)=$(VCRuntimeDllBaseName)$(VCRuntimeVersion)$(LibSuffix)$(WpfVersionSuffix)</DllRenameClause>
<DllRenameClause Condition="('$(UseStaticVCRT)'!='true' or '$(CLRSupport)'=='pure' or '$(CLRSupport)' == 'NetCore') And '$(Configuration)'=='Release'">/dllrename:$(VCRuntimeDllBaseName)$(VCRuntimeVersion)$(LibSuffix)=$(VCRuntimeDllBaseName)$(VCRuntimeVersion)$(LibSuffix)$(WpfVersionSuffix)</DllRenameClause>
<StandardLibrariesForNativeCpp Condition="'$(ManagedCxx)'=='false'">$(StaticUCRTLibrary);$(StaticVCRTLibrary);$(StaticCRTStartupLibrary);$(StaticStandardCppLibrary);$(DynamicUCRTLibrary);$(DynamicVCRTLibrary);$(DynamicCRTStartupLibrary);$(DynamicStandardCppLibrary)</StandardLibrariesForNativeCpp>
......@@ -158,7 +174,7 @@
<!-- These runtime libs should not have their default lib requests included during link. Instead, just use the explicitly intended libraries from this section -->
<NoDefaultLibClauseForRuntimeLibs>$(NoDefaultLibClauseForRuntimeLibs) /nodefaultlib:ucrt$(LibSuffix).lib /nodefaultlib:libucrt$(LibSuffix).lib /nodefaultlib:msvcrt$(LibSuffix).lib /nodefaultlib:libcmt$(LibSuffix).lib</NoDefaultLibClauseForRuntimeLibs>
<!-- Disable managed incremental builds to disable MetaGen task, which currently fails -->
<!-- Disable managed incremental builds to disable MetaGen task, which currently fails -->
<EnableManagedIncrementalBuild Condition="'$(ManagedCxx)'=='true'">false</EnableManagedIncrementalBuild>
<!-- Do not enable this - see GenerateTargetFrameworkMonikerAttribute2 target in Wpf.Cpp.targets for additional information -->
......@@ -176,13 +192,6 @@
<ProduceReferenceAssembly Condition="'$(ManagedCxx)'=='true'">false</ProduceReferenceAssembly>
</PropertyGroup>
<PropertyGroup>
<ComputeCompileInputsTargets Condition="$(ManagedCxx) == 'true'">
$(ComputeCompileInputsTargets);
SetMscorlibAdditionalUsingDirectory;
</ComputeCompileInputsTargets>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<WarningLevel>Level3</WarningLevel>
......
......@@ -186,13 +186,13 @@ END
<!--
This target is a replacement for GenerateTargetFrameworkMonikerAttribute defined in Microsoft.BuildSteps.Targets
We needed to ensure a few preconditions for this target, which necessitated a custom version to be written
- this target has to execute prior to SetMscorlibAdditionalUsingDirectory
- this target has to execute prior to ResolveAssemblyReferences
InitializeAssemblyAttributeInformation (defined in ExtendedAssemblyInfo.targets) must run prior to this target, to ensure that $(FileVersion) is populated
Additional assembly scope attributes besides TargetFrameworkAttribute are added here
-->
<Target Name="GenerateTargetFrameworkMonikerAttribute2"
Condition="'$(ManagedCxx)'=='true'"
BeforeTargets="SetMscorlibAdditionalUsingDirectory"
BeforeTargets="ResolveAssemblyReferences"
DependsOnTargets="PrepareForBuild;GetReferenceAssemblyPaths;InitializeAssemblyAttributeInformation"
Outputs="$(TargetFrameworkMonikerAssemblyAttributesPath)">
......@@ -264,33 +264,6 @@ using namespace System::Runtime::Versioning;
</ItemGroup>
</Target>
<!-- Remove mscorlib from AdditionalExplicitAssemblyReferences -->
<Target Name="RemoveMscoreLib"
AfterTargets="_PrepareForReferenceResolution"
DependsOnTargets="$(RemoveMscoreLibDependsOn)"
Condition="('$(ManagedCxx)'=='true') and $(TargetFramework.StartsWith('netcoreapp'))">
<ItemGroup>
<_AdditionalExplicitAssemblyReferences Include="$(AdditionalExplicitAssemblyReferences)" />
<_AdditionalExplicitAssemblyReferences Remove="mscorlib" />
</ItemGroup>
<PropertyGroup>
<AdditionalExplicitAssemblyReferences>@(_AdditionalExplicitAssemblyReferences)</AdditionalExplicitAssemblyReferences>
</PropertyGroup>
</Target>
<!-- Add the directory where mscorlib is located to AdditionalUsingDirectories -->
<Target Name="SetMscorlibAdditionalUsingDirectory" DependsOnTargets="ResolveAssemblyReferences"
Condition="('$(ManagedCxx)'=='true') and ('$(SetMscorlibAdditionalUsingDirectory)' != 'true')" >
<PropertyGroup>
<_mscorlibDirectory Condition="'%(ReferencePath.FileName)%(ReferencePath.Extension)' == 'mscorlib.dll'">%(ReferencePath.RootDir)%(ReferencePath.Directory)</_mscorlibDirectory>
</PropertyGroup>
<Error Condition="'$(_mscorlibDirectory)' == ''" Text="Could not locate mscorlib.dll" />
<ItemGroup>
<CLCompile>
<AdditionalUsingDirectories>%(CLCompile.AdditionalUsingDirectories);$(_mscorlibDirectory)</AdditionalUsingDirectories>
</CLCompile>
</ItemGroup>
</Target>
<PropertyGroup Condition="'$(ManagedCxx)'=='true'">
<ResolveReferencesDependsOn>
......@@ -348,26 +321,11 @@ using namespace System::Runtime::Versioning;
</Text>
</CppClrSupportProject>
<!--
We need a reference to Microsoft.DotNet.Wpf.GitHub when building from dotnet-wpf-int.
When building from dotnet/wpf, this refernece is not needed.
-->
<CppClrSupportProject Include="MicrosoftDotNetWpfGitHubPackageReference" Condition="'$(RepoLocation)'=='Internal'">
<Text>
<![CDATA[
<ItemGroup>
<PackageReference Include="runtime.$(WpfRuntimeIdentifier).$(GitHubTransportPackageName)" Version="$(MicrosoftDotNetWpfGitHubVersion)" />
</ItemGroup>
]]>
</Text>
</CppClrSupportProject>
<CppClrSupportProject Include="ProjectBody">
<Text>
<![CDATA[
<!-- Ensure that LimitMicrosoftDotNetWpfGitHubReferences target doesn't run -->
<PropertyGroup>
<DoNotLimitMicrosoftDotNetWpfGitHubReferences>true</DoNotLimitMicrosoftDotNetWpfGitHubReferences>
</PropertyGroup>
<Target Name="EnumerateAdditionalNugetReference"
BeforeTargets="_GenerateRestoreGraph"
......@@ -393,8 +351,6 @@ using namespace System::Runtime::Versioning;
<!-- Save Microsoft.NETCore.App assemblies and return them -->
<ItemGroup>
<NugetReferencesForCppCli Remove="%40(NugetReferencesForCppCli)" />
<NugetReferencesForCppCli Include="%40(ReferencePath)" Condition="'%25(ReferencePath.NuGetPackageId)'=='Microsoft.NETCore.App'"/>
<NugetReferencesForCppCli Include="%40(ReferencePath)" Condition="'%25(ReferencePath.NuGetPackageId)'=='runtime.%24(WpfRuntimeIdentifier).$(GitHubTransportPackageName)'"/>
</ItemGroup>
<FilterItem1ByItem2 Item1="%40(ReferencePath->'%25(NuGetPackageId)')"
PreserveItem1Metadata="true"
......@@ -632,9 +588,6 @@ using namespace System::Runtime::Versioning;
</ItemGroup>
</Target>
<!-- Disable the portions of MSBuild that insist on a targeting pack directory to represent a target framework -->
<Import Project="..\targets\Microsoft.NET.DisableStandardFrameworkResolution.targets" Sdk="Microsoft.NET.Sdk"
Condition="'$(ManagedCxx)'=='true'" />
<Import Project="$(MSBuildThisFileDirectory)ResourceLinking.targets" />
</Project>
......@@ -8,7 +8,7 @@
]
},
"vs": {
"version": "16.1"
"version": "16.4"
}
},
"sdk": {
......
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
......@@ -21,17 +19,24 @@
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup>
<CLRSupport>pure</CLRSupport>
<ConfigurationType>DynamicLibrary</ConfigurationType>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>netcoreapp5.0</TargetFramework>
<TargetFrameworkIdentifier>.NETCoreApp</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup>
<Keyword>NetCoreCProj</Keyword>
<CLRSupport>pure</CLRSupport>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<ConfigurationType>DynamicLibrary</ConfigurationType>
</PropertyGroup>
<Import Project="$(WpfCppProps)" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
......@@ -39,7 +44,7 @@
<ProjectGuid>{50A5318F-3B9A-48B9-9615-D5FA9D6D9C3E}</ProjectGuid>
<UseClrCrt>true</UseClrCrt>
<OutputName>DirectWriteForwarder</OutputName>
<TargetType>DYNLINK</TargetType>
<TargetType>library</TargetType>
<LinkSubSystem>CONSOLE</LinkSubSystem>
<CDefines>$(CDefines);PRESENTATION_CORE=1;INTEL</CDefines>
</PropertyGroup>
......@@ -86,6 +91,13 @@
<AdditionalPackageReference Include="$(SystemIOPackagingPackage)" Version="$(SystemIOPackagingVersion)" />
</ItemGroup>
<!--
Ignore ijwhost.dll during packaging
-->
<ItemGroup>
<FileNamesExcludedFromPackaging Include="ijwhost.dll" />
</ItemGroup>
<Target Name="AddWindowsBaseDefine" AfterTargets="ResolveProjectReferences">
<Error Text="Unexpected result from _WindowsBaseReference" Condition="'@(_WindowsBaseReference->Count())' != '1'" />
<PropertyGroup>
......@@ -106,4 +118,9 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<!-- Provide a stub Pack target for C++/CLI -->
<Target Name="Pack" DependsOnTargets="$(PackDependsOn)">
<IsPackableFalseWarningTask Condition="'$(IsPackable)' == 'false' AND '$(WarnOnPackingNonPackableProject)' == 'true'"/>
</Target>
</Project>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
......@@ -21,16 +19,21 @@
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup>
<CLRSupport>pure</CLRSupport>
<ConfigurationType>DynamicLibrary</ConfigurationType>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>netcoreapp5.0</TargetFramework>
<TargetFrameworkIdentifier>.NETCoreApp</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup>
<Keyword>NetCoreCProj</Keyword>
<CLRSupport>pure</CLRSupport>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<ConfigurationType>DynamicLibrary</ConfigurationType>
</PropertyGroup>
<Import Project="$(WpfCppProps)" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
......@@ -39,7 +42,7 @@
<ProjectGuid>{765E6BBC-772B-4808-BB72-E85615E8F237}</ProjectGuid>
<UseClrCrt>true</UseClrCrt>
<OutputName>System.Printing</OutputName>
<TargetType>DYNLINK</TargetType>
<TargetType>library</TargetType>
<LinkSubSystem>CONSOLE</LinkSubSystem>
</PropertyGroup>
......@@ -162,6 +165,13 @@
<AdditionalPackageReference Include="$(SystemIOPackagingPackage)" Version="$(SystemIOPackagingVersion)" />
</ItemGroup>
<!--
Ignore ijwhost.dll during packaging
-->
<ItemGroup>
<FileNamesExcludedFromPackaging Include="ijwhost.dll" />
</ItemGroup>
<Target Name="AddDefineReferences" BeforeTargets="ClCompile" AfterTargets="ResolveReferences" Returns="@(CLCompile)">
<PropertyGroup>
<_defineReferences>@(_defineReference->'%(Define)=&lt;%(Identity)&gt;')</_defineReferences>
......@@ -240,4 +250,9 @@
</Target>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<!-- Provide a stub Pack target for C++/CLI -->
<Target Name="Pack" DependsOnTargets="$(PackDependsOn)">
<IsPackableFalseWarningTask Condition="'$(IsPackable)' == 'false' AND '$(WarnOnPackingNonPackableProject)' == 'true'"/>
</Target>
</Project>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册