Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions eng/WpfArcadeSdk/tools/Packaging.targets
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,21 @@ $(PreparePackageAssetsDependsOn):
<DestinationSubFolder Condition="'$(Platform)'=='arm64'">runtimes\win-arm64\native\</DestinationSubFolder>
</PropertyGroup>

<!--
For managed C++/CLI projects (vcxproj with UseDestinationLibFolder), ijwhost.dll is automatically
produced in the output directory but must be packaged as a native assembly under runtimes\<rid>\native\
rather than alongside managed assemblies under lib\<tfm>\.
-->
<PropertyGroup Condition="'$(MSBuildProjectExtension)'=='.vcxproj' and '$(UseDestinationLibFolder)' != ''">
<NativeRuntimeSubFolder Condition="'$(Platform)'=='AnyCPU' or '$(Platform)'=='x86' or '$(Platform)'=='Win32'">runtimes\win-x86\native\</NativeRuntimeSubFolder>
<NativeRuntimeSubFolder Condition="'$(Platform)'=='x64'">runtimes\win-x64\native\</NativeRuntimeSubFolder>
<NativeRuntimeSubFolder Condition="'$(Platform)'=='arm64'">runtimes\win-arm64\native\</NativeRuntimeSubFolder>
</PropertyGroup>

<ItemGroup Condition="'$(MSBuildProjectExtension)'=='.vcxproj' and '$(UseDestinationLibFolder)' != ''">
<FileNamesExcludedFromPackaging Include="ijwhost.dll" />
</ItemGroup>

<!--
Instead of showing an error when $(TargetFramework) or $(RuntimeIdentifier) cannot be identified
we simply do no further work
Expand Down Expand Up @@ -118,6 +133,13 @@ $(PreparePackageAssetsDependsOn):
<Output ItemName="PackageAsset" TaskParameter="Include"/>
</CreateItem>

<!-- Route ijwhost.dll to runtimes\<rid>\native\ for managed C++/CLI projects -->
<CreateItem Include="$(OutDir)ijwhost.dll"
AdditionalMetadata="RelativePath=$(ArtifactsPackagingDir)$(NormalizedPackageName)\$(NativeRuntimeSubFolder)"
Condition="'$(NativeRuntimeSubFolder)'!='' and '$(DestinationSubFolder)'!='' and '$(IsPackagingProject)'!='true' and Exists('$(OutDir)ijwhost.dll')">
<Output ItemName="PackageAsset" TaskParameter="Include"/>
</CreateItem>

<!--
Normally, .lib files are not included in packaging - projects have to opt in by setting
<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
<ItemGroup>
<AdditionalPackageReference Include="$(SystemIOPackagingPackage)" Version="$(SystemIOPackagingVersion)" />
</ItemGroup>
<!-- ijwhost.dll is required for mixed-mode C++/CLI assemblies -->
<!-- ijwhost.dll packaging is handled centrally in eng/WpfArcadeSdk/tools/Packaging.targets -->
<Target Name="AddWindowsBaseDefine" AfterTargets="ResolveProjectReferences">
<Error Text="Unexpected result from _WindowsBaseReference '@(_WindowsBaseReference->Count())'" Condition="'@(_WindowsBaseReference->Count())' != '1'" />
<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
<ItemGroup>
<AdditionalPackageReference Include="$(SystemIOPackagingPackage)" Version="$(SystemIOPackagingVersion)" />
</ItemGroup>
<!-- ijwhost.dll is required for mixed-mode C++/CLI assemblies -->
<!-- ijwhost.dll packaging is handled centrally in eng/WpfArcadeSdk/tools/Packaging.targets -->
<Target Name="AddDefineReferences" BeforeTargets="ClCompile" AfterTargets="ResolveReferences" Returns="@(CLCompile)">
<PropertyGroup>
<_defineReferences>@(_defineReference->'%(Define)=&lt;%(Identity)&gt;')</_defineReferences>
Expand Down