forked from rosebudai/OpenRCT2-Web
Build Performance Optimization (#26015)
* Build Performance Optimization * Fixed include order formatting * Reverted CMakeLists.txt * Fixed pch implementation * Removed cmake pch * Update test/tests/CMakeLists.txt --------- Co-authored-by: Michał Janiszewski <janisozaur@users.noreply.github.com>
This commit is contained in:
1 parent
1e3d1cf252
commit
52d7e1833b
9 files changed
+80
-4
No files matched your search
@@ -21,6 +21,10 @@
|
||||
<VcpkgTriplet Condition="'$(Platform)'=='x64' and '$(UseSharedLibs)'!='true'">x64-windows-static</VcpkgTriplet>
|
||||
<VcpkgTriplet Condition="'$(Platform)'=='arm64' and '$(UseSharedLibs)'!='true'">arm64-windows-static</VcpkgTriplet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<!-- Enable Precompiled Headers by default for better build performance -->
|
||||
<UsePCH Condition="'$(UsePCH)'==''">true</UsePCH>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
</PropertyGroup>
|
||||
@@ -131,3 +135,4 @@
|
||||
<VcpkgEnabled>false</VcpkgEnabled>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<SolutionDir Condition="'$(SolutionDir)'==''">..\..\</SolutionDir>
|
||||
@@ -80,6 +80,7 @@
|
||||
<ClInclude Include="interface\ViewportQuery.h" />
|
||||
<ClInclude Include="interface\Widget.h" />
|
||||
<ClInclude Include="interface\Window.h" />
|
||||
<ClInclude Include="openrct2ui_pch.h" />
|
||||
<ClInclude Include="ride\Construction.h" />
|
||||
<ClInclude Include="ride\VehicleSounds.h" />
|
||||
<ClInclude Include="scripting\CustomImages.h" />
|
||||
@@ -145,6 +146,9 @@
|
||||
<ClCompile Include="interface\ViewportQuery.cpp" />
|
||||
<ClCompile Include="interface\Widget.cpp" />
|
||||
<ClCompile Include="interface\Window.cpp" />
|
||||
<ClCompile Include="openrct2ui_pch.cpp" Condition="'$(UsePCH)'=='true'">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ride\Construction.cpp" />
|
||||
<ClCompile Include="ride\VehicleSounds.cpp" />
|
||||
<ClCompile Include="scripting\CustomImages.cpp" />
|
||||
@@ -255,6 +259,9 @@
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions Condition="'$(Breakpad)'=='true' and ('$(Platform)'=='Win32' or '$(Platform)'=='x64')">USE_BREAKPAD;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader Condition="'$(UsePCH)'=='true'">Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile Condition="'$(UsePCH)'=='true'">openrct2ui_pch.h</PrecompiledHeaderFile>
|
||||
<ForcedIncludeFiles Condition="'$(UsePCH)'=='true'">openrct2ui_pch.h</ForcedIncludeFiles>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup>
|
||||
@@ -268,4 +275,4 @@
|
||||
</Lib>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
||||
</Project>
|
||||
@@ -0,0 +1,2 @@
|
||||
// Empty file for MSVC's PCH
|
||||
// Do not include the header file - it is set up with MSVC solution
|
||||
@@ -0,0 +1,24 @@
|
||||
#pragma once
|
||||
|
||||
// Precompiled header for libopenrct2ui project
|
||||
|
||||
// Standard library headers that are expensive to compile
|
||||
#include <algorithm>
|
||||
#include <filesystem>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
// Project core headers (from libopenrct2) that are used in UI
|
||||
#include "../openrct2/Context.h"
|
||||
#include "../openrct2/GameState.h"
|
||||
#include "../openrct2/core/StringTypes.h"
|
||||
|
||||
// Interface headers that are widely used in UI
|
||||
// Note: These must be in dependency order
|
||||
#include "../openrct2/interface/Viewport.h"
|
||||
#include "../openrct2/interface/Window.h"
|
||||
#include "interface/Viewport.h"
|
||||
#include "interface/Widget.h"
|
||||
#include "interface/Window.h"
|
||||
@@ -391,7 +391,7 @@
|
||||
<ClInclude Include="object\WaterEntry.h" />
|
||||
<ClInclude Include="object\WaterObject.h" />
|
||||
<ClInclude Include="OpenRCT2.h" />
|
||||
<ClInclude Include="openrct2_pch.h" Condition="'$(UsePCH)'=='true'" />
|
||||
<ClInclude Include="openrct2_pch.h"/>
|
||||
<ClInclude Include="paint\Boundbox.h" />
|
||||
<ClInclude Include="paint\Paint.Entity.h" />
|
||||
<ClInclude Include="paint\Paint.h" />
|
||||
|
||||
@@ -2,7 +2,24 @@
|
||||
|
||||
// Include some expensive headers here to improve compilation speed
|
||||
|
||||
// Standard library headers that are frequently used and expensive to compile
|
||||
#include <algorithm>
|
||||
#include <chrono>
|
||||
#include <filesystem>
|
||||
#include <ranges>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
// Core project headers with high compile cost and wide usage
|
||||
#include "core/DataSerialiser.h"
|
||||
#include "core/DataSerialiserTraits.h"
|
||||
#include "core/FileSystem.hpp"
|
||||
#include "core/StringTypes.h"
|
||||
|
||||
// Key project headers used across many files
|
||||
#include "Context.h"
|
||||
#include "GameState.h"
|
||||
#include "object/Object.h"
|
||||
#include "rct2/RCT2.h"
|
||||
#include "ride/Ride.h"
|
||||
@@ -59,6 +59,9 @@
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>GTEST_LANG_CXX11;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader Condition="'$(UsePCH)'=='true'">Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile Condition="'$(UsePCH)'=='true'">tests_pch.h</PrecompiledHeaderFile>
|
||||
<ForcedIncludeFiles Condition="'$(UsePCH)'=='true'">tests_pch.h</ForcedIncludeFiles>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>libopenrct2.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
@@ -76,6 +79,7 @@
|
||||
<ClInclude Include="AssertHelpers.hpp" />
|
||||
<ClInclude Include="helpers\StringHelpers.hpp" />
|
||||
<ClInclude Include="TestData.h" />
|
||||
<ClInclude Include="tests_pch.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="BitSetTests.cpp" />
|
||||
@@ -102,6 +106,9 @@
|
||||
<ClCompile Include="TestData.cpp" />
|
||||
<ClCompile Include="tests.cpp" />
|
||||
<ClCompile Include="StringTest.cpp" />
|
||||
<ClCompile Include="tests_pch.cpp" Condition="'$(UsePCH)'=='true'">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="TileElements.cpp" />
|
||||
<ClCompile Include="TileElementsView.cpp" />
|
||||
</ItemGroup>
|
||||
@@ -119,4 +126,5 @@
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
// Empty file for MSVC's PCH
|
||||
// Do not include the header file - it is set up with MSVC solution
|
||||
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
// Precompiled header for tests project
|
||||
|
||||
// GTest headers
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
// Standard library headers
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
Reference in new issue
Block a user