Skip to content

Commit 039c919

Browse files
authored
UWP: Directly add cppwinrt to fix issues related to nuget restore (libretro#18572)
1 parent 367d2ee commit 039c919

File tree

13 files changed

+1415
-316
lines changed

13 files changed

+1415
-316
lines changed

pkg/msvc-uwp/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ AppPackages/
1111
/x64
1212
/ARM64
1313

14+
# Microsoft.Windows.CppWinRT
15+
!/packages/Microsoft.Windows.CppWinRT.2.0.250303.1/bin/*
16+
!/packages/Microsoft.Windows.CppWinRT.2.0.250303.1/build/*
17+
1418
# MESA
1519
!/RetroArch-msvcUWP/MESA/x64/*.dll
1620
!/RetroArch-msvcUWP/MESA/x64/*.lib

pkg/msvc-uwp/RetroArch-msvcUWP/RetroArch-msvcUWP.vcxproj

Lines changed: 315 additions & 316 deletions
Large diffs are not rendered by default.
Binary file not shown.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) Microsoft Corporation.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE
Binary file not shown.
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Rule Name="CppWinRT" DisplayName="C++/WinRT" Order="75" PageTemplate="generic" xmlns="http://schemas.microsoft.com/build/2009/properties">
3+
4+
<Rule.Categories>
5+
<Category Name="General" DisplayName="General"/>
6+
</Rule.Categories>
7+
8+
<Rule.DataSource>
9+
<DataSource Persistence="ProjectFile" HasConfigurationCondition="false" Label="Globals" />
10+
</Rule.DataSource>
11+
12+
<StringProperty Name="RootNamespace"
13+
DisplayName="Root Namespace"
14+
Description="Specifies the default namespace to be used with new files created in this project."
15+
Category="General" />
16+
17+
<EnumProperty Name="CppWinRTVerbosity"
18+
DisplayName="Verbosity"
19+
Description="Sets the importance of C++/WinRT build messages"
20+
Category="General">
21+
<EnumValue Name="low" DisplayName="low" Description="Enables messages when MSBuild verbosity is set to at least 'detailed'" />
22+
<EnumValue Name="normal" DisplayName="normal" Description="Enables messages when MSBuild verbosity is set to at least 'normal'" />
23+
<EnumValue Name="high" DisplayName="high" Description="Enables messages when MSBuild verbosity is set to at least 'minimal'" />
24+
</EnumProperty>
25+
26+
<EnumProperty Name="CppWinRTProjectLanguage"
27+
DisplayName="Project Language"
28+
Description="Sets the C++ dialect for the project. C++/WinRT provides full projection support, C++/CX permits consuming projection headers."
29+
Category="General">
30+
<EnumValue Name="C++/WinRT" DisplayName="C++/WinRT" Description="Enables full consuming and producing projection support and Xaml integration" />
31+
<EnumValue Name="C++/CX" DisplayName="C++/CX" Description="Enables C++/CX code to generate and use consuming projections" />
32+
</EnumProperty>
33+
34+
<BoolProperty Name="CppWinRTLibs"
35+
DisplayName="Umbrella Library"
36+
Description="Adds the WindowsApp.lib umbrella library for Windows Runtime imports"
37+
Category="General" />
38+
39+
<BoolProperty Name="CppWinRTModernIDL"
40+
DisplayName="Modern IDL"
41+
Description="Enables midlrt.exe modern IDL support (disable for custom behavior such as proxy/stub generation)"
42+
Category="General" />
43+
44+
<IntProperty Name="CppWinRTNamespaceMergeDepth"
45+
DisplayName="Namespace Merge Depth"
46+
Description="Overrides the depth of mdmerge.exe namespace merging (Xaml apps require 1)"
47+
Category="General" />
48+
49+
<BoolProperty Name="CppWinRTRootNamespaceAutoMerge"
50+
DisplayName="Use Root Namespace Merge Depth"
51+
Description="Use the Root Namespace as the default merge depth"
52+
Category="General" />
53+
54+
<BoolProperty Name="CppWinRTUsePrefixes"
55+
DisplayName="Use Prefixes"
56+
Description="Uses a dotted prefix namespace convention (versus a nested folder convention)"
57+
Category="General" />
58+
59+
<StringProperty Name="CppWinRTParameters"
60+
DisplayName="Additional Parameters"
61+
Description="Additional cppwinrt.exe command-line parameters"
62+
Category="General" />
63+
64+
<BoolProperty Name="CppWinRTFastAbi"
65+
DisplayName="Fast ABI"
66+
Description="Enables Fast ABI feature for both consuming and producing projections"
67+
Category="General" />
68+
69+
<BoolProperty Name="CppWinRTOptimized"
70+
DisplayName="Optimized"
71+
Description="Enables component projection optimization features (e.g., unified construction)"
72+
Category="General" />
73+
74+
<BoolProperty Name="CppWinRTGenerateWindowsMetadata"
75+
DisplayName="Generate Windows Metadata"
76+
Description="Enables or disables the generation of Windows Metadata"
77+
Category="General" />
78+
79+
<BoolProperty Name="CppWinRTEnableDefaultCopyLocalFalse"
80+
DisplayName="Enable C++/WinRT Copy Local Defaults"
81+
Description="Enables or disables the default for copying binaries to the output folder to be false"
82+
Category="General" />
83+
84+
<BoolProperty Name="CppWinRTEnableLegacyCoroutines"
85+
DisplayName="Enable legacy coroutines (C++17)"
86+
Description="Enables the /await compiler option (disable this if you want to pass this yourself)"
87+
Category="General" />
88+
89+
</Rule>
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<!--
2+
***********************************************************************************************
3+
Copyright (C) Microsoft Corporation. All rights reserved.
4+
***********************************************************************************************
5+
-->
6+
<!--Set compiler and linker options for projects requiring C++/WinRT. -->
7+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
8+
9+
<PropertyGroup>
10+
<!-- Only do this for MSBuild versions below 16.0
11+
as it is since done automatically, see https://github.com/microsoft/msbuild/pull/3605-->
12+
<MSBuildAllProjects Condition="'$(MSBuildToolsVersion)' &lt;= '15'">$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
13+
</PropertyGroup>
14+
15+
<PropertyGroup>
16+
<CanReferenceWinRT>true</CanReferenceWinRT>
17+
<CppWinRTPackage Condition="'$(CppWinRTEnabled)' != 'true'">true</CppWinRTPackage>
18+
<CppWinRTPackage Condition="'$(CppWinRTPackage)' != 'true'">false</CppWinRTPackage>
19+
<XamlLanguage Condition="'$(XamlLanguage)' == ''">CppWinRT</XamlLanguage>
20+
<IsNativeLanguage>true</IsNativeLanguage>
21+
<!-- This causes VS to add the platform WinMD references for the target SDK -->
22+
<WinMDAssembly>true</WinMDAssembly>
23+
<!--Set a value to prevent SDK's uap.props from setting it and pointing to the wrong headers-->
24+
<CppWinRT_IncludePath>PreventSdkUapPropsAssignment</CppWinRT_IncludePath>
25+
<CppWinRTEnableDefaultCopyLocalFalse Condition="'$(CppWinRTEnableDefaultCopyLocalFalse)' == ''">true</CppWinRTEnableDefaultCopyLocalFalse>
26+
</PropertyGroup>
27+
28+
<ItemDefinitionGroup>
29+
<ClCompile>
30+
<CompileAsWinRT Condition="'$(CppWinRTProjectLanguage)' != 'C++/CX' And '%(ClCompile.CompileAsWinRT)' == ''">false</CompileAsWinRT>
31+
<LanguageStandard Condition="'%(ClCompile.LanguageStandard)' == ''">stdcpp17</LanguageStandard>
32+
</ClCompile>
33+
<Midl Condition="'$(CppWinRTModernIDL)' != 'false'">
34+
<EnableWindowsRuntime>true</EnableWindowsRuntime>
35+
<MetadataFileName>$(IntDir)Unmerged\%(Filename).winmd</MetadataFileName>
36+
<GenerateClientFiles Condition="'%(Midl.GenerateClientFiles)'==''">None</GenerateClientFiles>
37+
<GenerateServerFiles Condition="'%(Midl.GenerateServerFiles)'==''">None</GenerateServerFiles>
38+
<GenerateStublessProxies Condition="'%(Midl.GenerateStublessProxies)'==''">false</GenerateStublessProxies>
39+
<GenerateTypeLibrary Condition="'%(Midl.GenerateTypeLibrary)'==''">false</GenerateTypeLibrary>
40+
<HeaderFileName Condition="'%(Midl.HeaderFileName)'==''">nul</HeaderFileName>
41+
<DllDataFileName Condition="'%(Midl.DllDataFileName)'==''">nul</DllDataFileName>
42+
<InterfaceIdentifierFileName Condition="'%(Midl.InterfaceIdentifierFileName)'==''">nul</InterfaceIdentifierFileName>
43+
<ProxyFileName Condition="'%(Midl.ProxyFileName)'==''">nul</ProxyFileName>
44+
<TypeLibraryName Condition="'%(Midl.TypeLibraryName)'==''"></TypeLibraryName>
45+
<NoMidl Condition="'%(Midl.NoMidl)'==''">true</NoMidl>
46+
</Midl>
47+
<ProjectReference Condition="'$(XamlLanguage)' != 'C++' and '$(CppWinRTEnableDefaultCopyLocalFalse)' == 'true'">
48+
<!-- By default, for a C++/WinRT project,
49+
don't copy project reference output to the output directory
50+
of the current project for projects that are not an exe. -->
51+
<Private Condition="'$(ConfigurationType)' != 'Application' and '$(OutputType)'!='winexe' and '$(OutputType)'!='exe' and '$(OutputType)'!='appcontainerexe'">false</Private>
52+
</ProjectReference>
53+
<Reference Condition="'$(XamlLanguage)' != 'C++' and '$(CppWinRTEnableDefaultCopyLocalFalse)' == 'true'">
54+
<!-- By default, for a C++/WinRT project,
55+
don't copy reference output to the output directory
56+
of the current project for projects that are not an exe. -->
57+
<Private Condition="'$(ConfigurationType)' != 'Application' and '$(OutputType)'!='winexe' and '$(OutputType)'!='exe' and '$(OutputType)'!='appcontainerexe'">false</Private>
58+
</Reference>
59+
</ItemDefinitionGroup>
60+
61+
<ItemGroup>
62+
<PropertyPageSchema Include="$(MSBuildThisFileDirectory)\CppWinrtRules.Project.xml"/>
63+
<ProjectCapability Include="CppWinRT" />
64+
</ItemGroup>
65+
66+
</Project>

0 commit comments

Comments
 (0)