forked from microsoft/CsWinRT
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add targets for hosting support (microsoft#665)
* add target to pack dlls in authored nupkg; target to add as references in consuming app * update docs to reflect new authoring support
- Loading branch information
Showing
4 changed files
with
195 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<Project ToolsVersion="15.0" xmln="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
|
||
<PropertyGroup> | ||
<!-- Add the hosting dlls to references so they get binplaced --> | ||
<ResolveReferencesDependsOn>CsWinRTCopyAuthoringDlls;$(ResolveReferencesDependsOn)</ResolveReferencesDependsOn> | ||
<!-- Add authored component's winmd to references before C++/WinRT runs --> | ||
<BuildDependsOn>CsWinRTAddAuthoredWinMDReference;$(BuildDependsOn)</BuildDependsOn> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<HostingSupport-NativeDir>$(MSBuildThisFileDirectory)..\lib\native</HostingSupport-NativeDir> | ||
<HostingSupport-MetadataDir>$(MSBuildThisFileDirectory)..\winmd</HostingSupport-MetadataDir> | ||
<HostingSupport-RuntimesDir>$(MSBuildThisFileDirectory)..\runtimes</HostingSupport-RuntimesDir> | ||
<HostingSupport-IsNative Condition="'$(TargetFramework)' == 'native' OR '$(TargetFramework)' == ''">true</HostingSupport-IsNative> | ||
<HostingSupport-IsArmArch Condition="'$(Platform)' == 'arm' OR '$(Platform)' == 'arm64'">true</HostingSupport-IsArmArch> | ||
</PropertyGroup> | ||
|
||
<!-- Happens before building, so C++/WinRT can make the corresponding header files --> | ||
<Target Name="CsWinRTAddAuthoredWinMDReference" | ||
Condition="'$(HostingSupport-IsNative)' == 'true'" | ||
Outputs="@(Reference)"> | ||
<ItemGroup> | ||
<Reference Include="$(HostingSupport-MetadataDir)\*" /> | ||
</ItemGroup> | ||
</Target> | ||
|
||
<!-- Happens when resolving references, so the app can be hosted --> | ||
<Target Name="CsWinRTCopyAuthoringDlls" | ||
Condition="'$(HostingSupport-IsNative)' == 'true'" | ||
Outputs="@(ReferenceCopyLocalPaths)"> | ||
|
||
<ItemGroup Label="Copy Dlls needed for hosting/using authored components"> | ||
<ReferenceCopyLocalPaths Include="$(HostingSupport-NativeDir)\*" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Label="Copy the WinRT.Host dll, based on architecture"> | ||
<ReferenceCopyLocalPaths Include="$(HostingSupport-RuntimesDir)\win-$(Platform)\native\WinRT.Host.dll" | ||
Condition="'$(Platform)' == 'x64' OR '$(Platform)' == 'x86' OR '$(HostingSupport-IsArmArch)' == 'true'" /> | ||
|
||
<ReferenceCopyLocalPaths Include="$(HostingSupport-RuntimesDir)\win-x86\native\WinRT.Host.dll" | ||
Condition="'$(Platform)' == 'Win32'"/> | ||
</ItemGroup> | ||
</Target> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.