Build: Add UWP configurations

This commit is contained in:
Connor McLaughlin 2021-07-04 19:08:55 +10:00
parent c0352eb19f
commit 281f7c5789
9 changed files with 130 additions and 33 deletions

4
.gitignore vendored
View File

@ -40,3 +40,7 @@ __pycache__
# other repos
/dep/mac
# UWP crap
Generated Files
/packages

View File

@ -30,15 +30,23 @@
</Link>
</ItemDefinitionGroup>
<!-- Disable exceptions. -->
<ItemDefinitionGroup>
<!-- Disable exceptions when not building for UWP. -->
<ItemDefinitionGroup Condition="'$(BuildingForUWP)'!='true'">
<ClCompile>
<PreprocessorDefinitions>_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>false</ExceptionHandling>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
<ItemDefinitionGroup Condition="'$(BuildingForUWP)'=='true'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<AdditionalIncludeDirectories></AdditionalIncludeDirectories>
<PreprocessorDefinitions>_UWP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug' Or '$(Configuration)'=='DebugUWP'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@ -67,7 +75,7 @@
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='ReleaseLTCG'">
<ItemDefinitionGroup Condition="'$(Configuration)'=='ReleaseLTCG' Or '$(Configuration)'=='ReleaseUWP'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>

View File

@ -49,18 +49,59 @@
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DebugUWP|ARM64">
<Configuration>DebugUWP</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DebugUWP|Win32">
<Configuration>DebugUWP</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DebugUWP|x64">
<Configuration>DebugUWP</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseUWP|ARM64">
<Configuration>ReleaseUWP</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseUWP|Win32">
<Configuration>ReleaseUWP</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseUWP|x64">
<Configuration>ReleaseUWP</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="UserMacros">
<BuildingForUWP Condition="'$(Configuration)'=='DebugUWP' Or '$(Configuration)'=='ReleaseUWP'">true</BuildingForUWP>
</PropertyGroup>
<Import Project="$(SolutionDir)packages\Microsoft.Windows.CppWinRT.2.0.210505.3\build\native\Microsoft.Windows.CppWinRT.props" Condition="('$(Configuration)'=='DebugUWP' Or '$(Configuration)'=='ReleaseUWP') And Exists('$(SolutionDir)packages\Microsoft.Windows.CppWinRT.2.0.210505.3\build\native\Microsoft.Windows.CppWinRT.props')" />
<PropertyGroup Label="Globals">
<ProjectName>$(MSBuildProjectName)</ProjectName>
<RootNamespace>$(MSBuildProjectName)</RootNamespace>
</PropertyGroup>
<PropertyGroup Label="Globals">
<PropertyGroup Label="Globals" Condition="'$(BuildingForUWP)'!='true'">
<Keyword>Win32Proj</Keyword>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<PropertyGroup Label="Globals" Condition="'$(BuildingForUWP)'=='true'">
<MinimalCoreWin>true</MinimalCoreWin>
<DefaultLanguage>en-US</DefaultLanguage>
<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
<AppContainerApplication>true</AppContainerApplication>
<ApplicationType>Windows Store</ApplicationType>
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
<WindowsTargetPlatformVersion Condition="'$(WindowsTargetPlatformVersion)' == '' ">10.0.19041.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.17134.0</WindowsTargetPlatformMinVersion>
</PropertyGroup>
<PropertyGroup Label="UserMacros">
<RootBuildDir>$(SolutionDir)build\$(Configuration)-$(Platform)\</RootBuildDir>
</PropertyGroup>

View File

@ -8,6 +8,12 @@
<ConfigurationType>StaticLibrary</ConfigurationType>
</PropertyGroup>
<PropertyGroup Label="Globals" Condition="'$(BuildingForUWP)'=='true'">
<CppWinRTOptimized Condition="'$(Configuration)'=='ReleaseUWP'">true</CppWinRTOptimized>
<CppWinRTRootNamespaceAutoMerge>false</CppWinRTRootNamespaceAutoMerge>
<CppWinRTGenerateWindowsMetadata>false</CppWinRTGenerateWindowsMetadata>
</PropertyGroup>
<Import Project="Toolkit.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />

View File

@ -1,4 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<Import Project="$(SolutionDir)packages\Microsoft.Windows.CppWinRT.2.0.210505.3\build\native\Microsoft.Windows.CppWinRT.targets" Condition="'$(BuildingForUWP)'=='true' And Exists('$(SolutionDir)packages\Microsoft.Windows.CppWinRT.2.0.210505.3\build\native\Microsoft.Windows.CppWinRT.props')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="'$(BuildingForUWP)'=='true' And !Exists('$(SolutionDir)packages\Microsoft.Windows.CppWinRT.2.0.210505.3\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)packages\Microsoft.Windows.CppWinRT.2.0.210505.3\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="'$(BuildingForUWP)'=='true' And !Exists('$(SolutionDir)packages\Microsoft.Windows.CppWinRT.2.0.210505.3\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)packages\Microsoft.Windows.CppWinRT.2.0.210505.3\build\native\Microsoft.Windows.CppWinRT.targets'))" />
</Target>
</Project>

View File

@ -6,10 +6,10 @@
<SpectreMitigation>false</SpectreMitigation>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Debug' Or '$(Configuration)'=='DebugFast'">
<PropertyGroup Condition="'$(Configuration)'=='Debug' Or '$(Configuration)'=='DebugFast' Or '$(Configuration)'=='DebugUWP'">
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release' Or '$(Configuration)'=='ReleaseLTCG'">
<PropertyGroup Condition="'$(Configuration)'=='Release' Or '$(Configuration)'=='ReleaseLTCG' Or '$(Configuration)'=='ReleaseUWP'">
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
</Project>

View File

@ -33,8 +33,7 @@
<ClInclude Include="file_system.h" />
<ClInclude Include="gl\context.h" />
<ClInclude Include="gl\context_wgl.h">
<ExcludedFromBuild Condition="'$(Platform)'=='ARM' Or '$(Platform)'=='ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)'=='DebugUWP' Or '$(Configuration)'=='ReleaseUWP'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Platform)'=='ARM' Or '$(Platform)'=='ARM64' Or '$(BuildingForUWP)'=='true'">true</ExcludedFromBuild>
</ClInclude>
<ClInclude Include="gl\program.h" />
<ClInclude Include="gl\shader_cache.h" />
@ -62,7 +61,9 @@
<ClInclude Include="state_wrapper.h" />
<ClInclude Include="string.h" />
<ClInclude Include="string_util.h" />
<ClInclude Include="thirdparty\StackWalker.h" />
<ClInclude Include="thirdparty\StackWalker.h">
<ExcludedFromBuild Condition="'$(BuildingForUWP)'=='true'">true</ExcludedFromBuild>
</ClInclude>
<ClInclude Include="timer.h" />
<ClInclude Include="timestamp.h" />
<ClInclude Include="types.h" />
@ -79,7 +80,9 @@
<ClInclude Include="vulkan\texture.h" />
<ClInclude Include="vulkan\util.h" />
<ClInclude Include="wav_writer.h" />
<ClInclude Include="win32_progress_callback.h" />
<ClInclude Include="win32_progress_callback.h">
<ExcludedFromBuild Condition="'$(BuildingForUWP)'=='true'">true</ExcludedFromBuild>
</ClInclude>
<ClInclude Include="window_info.h" />
</ItemGroup>
<ItemGroup>
@ -116,8 +119,7 @@
<ClCompile Include="file_system.cpp" />
<ClCompile Include="gl\context.cpp" />
<ClCompile Include="gl\context_wgl.cpp">
<ExcludedFromBuild Condition="'$(Platform)'=='ARM' Or '$(Platform)'=='ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)'=='DebugUWP' Or '$(Configuration)'=='ReleaseUWP'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Platform)'=='ARM' Or '$(Platform)'=='ARM64' Or '$(BuildingForUWP)'=='true'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="gl\program.cpp" />
<ClCompile Include="gl\shader_cache.cpp" />
@ -140,7 +142,7 @@
<ClCompile Include="string.cpp" />
<ClCompile Include="string_util.cpp" />
<ClCompile Include="thirdparty\StackWalker.cpp">
<ExcludedFromBuild Condition="'$(Configuration)'=='DebugUWP' Or '$(Configuration)'=='ReleaseUWP'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(BuildingForUWP)'=='true'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="timer.cpp" />
<ClCompile Include="timestamp.cpp" />
@ -155,7 +157,9 @@
<ClCompile Include="vulkan\texture.cpp" />
<ClCompile Include="vulkan\util.cpp" />
<ClCompile Include="wav_writer.cpp" />
<ClCompile Include="win32_progress_callback.cpp" />
<ClCompile Include="win32_progress_callback.cpp">
<ExcludedFromBuild Condition="'$(BuildingForUWP)'=='true'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="window_info.cpp" />
</ItemGroup>
<ItemGroup>

View File

@ -12,7 +12,7 @@
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(BuildingForUWP)'!='true'">
<ClCompile>
<PreprocessorDefinitions>WITH_SDL2=1;WITH_DINPUT=1;WITH_DISCORD_PRESENCE=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)dep\cubeb\include;$(SolutionDir)dep\discord-rpc\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@ -22,5 +22,5 @@
</Link>
</ItemDefinitionGroup>
<Import Project="..\..\dep\msvc\vsprops\SDL2Compile.props" />
<Import Project="..\..\dep\msvc\vsprops\SDL2Compile.props" Condition="'$(BuildingForUWP)'!='true'" />
</Project>

View File

@ -4,9 +4,13 @@
<ItemGroup>
<ClCompile Include="common_host_interface.cpp" />
<ClCompile Include="controller_interface.cpp" />
<ClCompile Include="cubeb_audio_stream.cpp" />
<ClCompile Include="cubeb_audio_stream.cpp">
<ExcludedFromBuild Condition="'$(BuildingForUWP)'=='true'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="d3d11_host_display.cpp" />
<ClCompile Include="dinput_controller_interface.cpp" />
<ClCompile Include="dinput_controller_interface.cpp">
<ExcludedFromBuild Condition="'$(BuildingForUWP)'=='true'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="fullscreen_ui.cpp" />
<ClCompile Include="fullscreen_ui_progress_callback.cpp" />
<ClCompile Include="game_database.cpp" />
@ -14,7 +18,9 @@
<ClCompile Include="game_list.cpp" />
<ClCompile Include="game_settings.cpp" />
<ClCompile Include="http_downloader.cpp" />
<ClCompile Include="http_downloader_winhttp.cpp" />
<ClCompile Include="http_downloader_winhttp.cpp">
<ExcludedFromBuild Condition="'$(BuildingForUWP)'=='true'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="icon.cpp" />
<ClCompile Include="imgui_fullscreen.cpp" />
<ClCompile Include="imgui_impl_dx11.cpp" />
@ -31,9 +37,15 @@
<ClCompile Include="postprocessing_shadergen.cpp" />
<ClCompile Include="cheevos.cpp" />
<ClCompile Include="save_state_selector_ui.cpp" />
<ClCompile Include="sdl_audio_stream.cpp" />
<ClCompile Include="sdl_controller_interface.cpp" />
<ClCompile Include="sdl_initializer.cpp" />
<ClCompile Include="sdl_audio_stream.cpp">
<ExcludedFromBuild Condition="'$(BuildingForUWP)'=='true'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="sdl_controller_interface.cpp">
<ExcludedFromBuild Condition="'$(BuildingForUWP)'=='true'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="sdl_initializer.cpp">
<ExcludedFromBuild Condition="'$(BuildingForUWP)'=='true'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="vulkan_host_display.cpp" />
<ClCompile Include="xaudio2_audio_stream.cpp" />
<ClCompile Include="xinput_controller_interface.cpp" />
@ -41,9 +53,13 @@
<ItemGroup>
<ClInclude Include="common_host_interface.h" />
<ClInclude Include="controller_interface.h" />
<ClInclude Include="cubeb_audio_stream.h" />
<ClInclude Include="cubeb_audio_stream.h">
<ExcludedFromBuild Condition="'$(BuildingForUWP)'=='true'">true</ExcludedFromBuild>
</ClInclude>
<ClInclude Include="d3d11_host_display.h" />
<ClInclude Include="dinput_controller_interface.h" />
<ClInclude Include="dinput_controller_interface.h">
<ExcludedFromBuild Condition="'$(BuildingForUWP)'=='true'">true</ExcludedFromBuild>
</ClInclude>
<ClInclude Include="fullscreen_ui.h" />
<ClInclude Include="fullscreen_ui_progress_callback.h" />
<ClInclude Include="game_database.h" />
@ -51,7 +67,9 @@
<ClInclude Include="game_list.h" />
<ClInclude Include="game_settings.h" />
<ClInclude Include="http_downloader.h" />
<ClInclude Include="http_downloader_winhttp.h" />
<ClInclude Include="http_downloader_winhttp.h">
<ExcludedFromBuild Condition="'$(BuildingForUWP)'=='true'">true</ExcludedFromBuild>
</ClInclude>
<ClInclude Include="icon.h" />
<ClInclude Include="imgui_fullscreen.h" />
<ClInclude Include="imgui_impl_dx11.h" />
@ -68,9 +86,15 @@
<ClInclude Include="postprocessing_shadergen.h" />
<ClInclude Include="cheevos.h" />
<ClInclude Include="save_state_selector_ui.h" />
<ClInclude Include="sdl_audio_stream.h" />
<ClInclude Include="sdl_controller_interface.h" />
<ClInclude Include="sdl_initializer.h" />
<ClInclude Include="sdl_audio_stream.h">
<ExcludedFromBuild Condition="'$(BuildingForUWP)'=='true'">true</ExcludedFromBuild>
</ClInclude>
<ClInclude Include="sdl_controller_interface.h">
<ExcludedFromBuild Condition="'$(BuildingForUWP)'=='true'">true</ExcludedFromBuild>
</ClInclude>
<ClInclude Include="sdl_initializer.h">
<ExcludedFromBuild Condition="'$(BuildingForUWP)'=='true'">true</ExcludedFromBuild>
</ClInclude>
<ClInclude Include="vulkan_host_display.h" />
<ClInclude Include="xaudio2_audio_stream.h" />
<ClInclude Include="xinput_controller_interface.h" />