Build: Use precompiled headers

This commit is contained in:
Stenzek
2023-09-02 13:41:41 +10:00
parent 817129328b
commit cee4f93097
36 changed files with 198 additions and 46 deletions

View File

@@ -4,6 +4,7 @@ add_executable(duckstation-nogui
nogui_platform.h
)
target_precompile_headers(duckstation-nogui PRIVATE "pch.h")
target_link_libraries(duckstation-nogui PRIVATE core util common imgui scmversion)
if(WIN32)

View File

@@ -3,6 +3,9 @@
<Import Project="..\..\dep\msvc\vsprops\Configurations.props" />
<ItemGroup>
<ClCompile Include="nogui_host.cpp" />
<ClCompile Include="pch.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="wayland_nogui_platform.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
@@ -14,6 +17,7 @@
<ItemGroup>
<ClInclude Include="nogui_host.h" />
<ClInclude Include="nogui_platform.h" />
<ClInclude Include="pch.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="wayland_nogui_platform.h">
<ExcludedFromBuild>true</ExcludedFromBuild>
@@ -48,5 +52,12 @@
</PropertyGroup>
<Import Project="..\..\dep\msvc\vsprops\Win32Application.props" />
<Import Project="..\core\core.props" />
<ItemDefinitionGroup>
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
</ClCompile>
</ItemDefinitionGroup>
<Import Project="..\..\dep\msvc\vsprops\Targets.props" />
</Project>

View File

@@ -5,6 +5,7 @@
<ClCompile Include="win32_nogui_platform.cpp" />
<ClCompile Include="wayland_nogui_platform.cpp" />
<ClCompile Include="x11_nogui_platform.cpp" />
<ClCompile Include="pch.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="resource.h" />
@@ -13,6 +14,7 @@
<ClInclude Include="nogui_platform.h" />
<ClInclude Include="wayland_nogui_platform.h" />
<ClInclude Include="x11_nogui_platform.h" />
<ClInclude Include="pch.h" />
</ItemGroup>
<ItemGroup>
<Manifest Include="duckstation-nogui.manifest" />

View File

@@ -426,9 +426,6 @@ void NoGUIHost::ProcessPlatformWindowResize(s32 width, s32 height, float scale)
void NoGUIHost::ProcessPlatformMouseMoveEvent(float x, float y)
{
if (g_gpu_device)
g_gpu_device->SetMousePosition(static_cast<s32>(x), static_cast<s32>(y));
InputManager::UpdatePointerAbsolutePosition(0, x, y);
ImGuiManager::UpdateMousePosition(x, y);
}
@@ -650,7 +647,7 @@ void NoGUIHost::CPUThreadMainLoop()
Host::PumpMessagesOnCPUThread();
System::Internal::IdlePollUpdate();
Host::RenderDisplay(false);
System::PresentDisplay(false);
if (!g_gpu_device->IsVsyncEnabled())
g_gpu_device->ThrottlePresentation();
}

View File

@@ -0,0 +1,4 @@
// SPDX-FileCopyrightText: 2019-2023 Connor McLaughlin <stenzek@gmail.com>
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
#include "pch.h"

View File

@@ -0,0 +1,6 @@
// SPDX-FileCopyrightText: 2019-2023 Connor McLaughlin <stenzek@gmail.com>
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
#pragma once
#include "core/pch.h"