1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-06 06:32:56 +01:00

Merge pull request #13068 from mwnciau/json-compilation-performance

Fix #13055: Replace includes of Json.hpp in header files with json_fwd.hpp
This commit is contained in:
Aaron van Geffen
2020-10-06 01:09:41 +02:00
committed by GitHub
30 changed files with 55 additions and 19 deletions

View File

@@ -25,7 +25,7 @@ jobs:
name: Check code formatting
runs-on: ubuntu-latest
container:
image: openrct2/openrct2-build:0.3.0-format
image: openrct2/openrct2-build:0.3.1-format
steps:
- name: Checkout
uses: actions/checkout@v1
@@ -81,7 +81,7 @@ jobs:
runs-on: ubuntu-latest
needs: [check-code-formatting]
container:
image: openrct2/openrct2-build:0.3.0-mingw
image: openrct2/openrct2-build:0.3.1-mingw
steps:
- name: Checkout
uses: actions/checkout@v2
@@ -96,7 +96,7 @@ jobs:
runs-on: ubuntu-latest
needs: [check-code-formatting]
container:
image: openrct2/openrct2-build:0.3.0-mingw
image: openrct2/openrct2-build:0.3.1-mingw
steps:
- name: Checkout
uses: actions/checkout@v2
@@ -145,7 +145,7 @@ jobs:
runs-on: ubuntu-latest
needs: [check-code-formatting]
container:
image: openrct2/openrct2-build:0.3.0-bionic
image: openrct2/openrct2-build:0.3.1-bionic
steps:
- name: Checkout
uses: actions/checkout@v1
@@ -180,7 +180,7 @@ jobs:
runs-on: ubuntu-latest
needs: [check-code-formatting]
container:
image: openrct2/openrct2-build:0.3.0-bionic32
image: openrct2/openrct2-build:0.3.1-bionic32
steps:
- name: Checkout
uses: actions/checkout@v1
@@ -220,7 +220,7 @@ jobs:
runs-on: ubuntu-latest
needs: [check-code-formatting]
container:
image: openrct2/openrct2-build:0.3.0-bionic
image: openrct2/openrct2-build:0.3.1-bionic
steps:
- name: Checkout
uses: actions/checkout@v1
@@ -278,7 +278,7 @@ jobs:
runs-on: ubuntu-latest
needs: [check-code-formatting]
container:
image: openrct2/openrct2-build:0.3.0-bionic
image: openrct2/openrct2-build:0.3.1-bionic
steps:
- name: Checkout
uses: actions/checkout@v1
@@ -290,7 +290,7 @@ jobs:
runs-on: ubuntu-latest
needs: [check-code-formatting]
container:
image: openrct2/openrct2-build:0.3.0-android
image: openrct2/openrct2-build:0.3.1-android
steps:
- name: Checkout
uses: actions/checkout@v1

View File

@@ -74,6 +74,8 @@
932A211E22D73CFA00C57EDB /* GameActionCompat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 932A20CF22D73CEE00C57EDB /* GameActionCompat.cpp */; };
932A211F22D73CFA00C57EDB /* GameActionRegistration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 932A20D322D73CEF00C57EDB /* GameActionRegistration.cpp */; };
932A212022D73CFA00C57EDB /* GameAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 932A211C22D73CFA00C57EDB /* GameAction.cpp */; };
93378D01252B4F550077D2D8 /* JsonFwd.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 93378D00252B4F550077D2D8 /* JsonFwd.hpp */; };
93378D03252B54140077D2D8 /* json_fwd.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 93378D02252B54140077D2D8 /* json_fwd.hpp */; };
933C55B524B858490057E64B /* SeaDecrypt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 933C55B424B858490057E64B /* SeaDecrypt.cpp */; };
933CBDB520CB1ACD00134678 /* Widget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 933CBDB120CB1ACC00134678 /* Widget.cpp */; };
933CBDB620CB1ACD00134678 /* Theme.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 933CBDB220CB1ACD00134678 /* Theme.cpp */; };
@@ -1064,6 +1066,8 @@
932A211B22D73CFA00C57EDB /* TrackSetBrakeSpeedAction.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = TrackSetBrakeSpeedAction.hpp; sourceTree = "<group>"; };
932A211C22D73CFA00C57EDB /* GameAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GameAction.cpp; sourceTree = "<group>"; };
932A211D22D73CFA00C57EDB /* LargeSceneryRemoveAction.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = LargeSceneryRemoveAction.hpp; sourceTree = "<group>"; };
93378D00252B4F550077D2D8 /* JsonFwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = JsonFwd.hpp; sourceTree = "<group>"; };
93378D02252B54140077D2D8 /* json_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = json_fwd.hpp; path = "build/json-3.9.1/include/nlohmann/json_fwd.hpp"; sourceTree = SOURCE_ROOT; };
933C55B424B858490057E64B /* SeaDecrypt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SeaDecrypt.cpp; sourceTree = "<group>"; };
933CBDB120CB1ACC00134678 /* Widget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Widget.cpp; sourceTree = "<group>"; };
933CBDB220CB1ACD00134678 /* Theme.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Theme.cpp; sourceTree = "<group>"; };
@@ -2263,6 +2267,7 @@
isa = PBXGroup;
children = (
93FB271E24ED32B7008241C9 /* json.hpp */,
93378D02252B54140077D2D8 /* json_fwd.hpp */,
);
name = nlohmann;
path = libxc/include/nlohmann;
@@ -2831,6 +2836,7 @@
2ADE2F25224418B2002598AF /* JobPool.hpp */,
F76C83881EC4E7CC00FA49E2 /* Json.cpp */,
F76C83891EC4E7CC00FA49E2 /* Json.hpp */,
93378D00252B4F550077D2D8 /* JsonFwd.hpp */,
F76C838B1EC4E7CC00FA49E2 /* Memory.hpp */,
F76C838C1EC4E7CC00FA49E2 /* MemoryStream.cpp */,
F76C838D1EC4E7CC00FA49E2 /* MemoryStream.h */,
@@ -3670,6 +3676,7 @@
93DFD05524521C1A001FCBAF /* ScMap.hpp in Headers */,
9308DA04209908090079EE96 /* TileElement.h in Headers */,
C67B28152002D67A00109C93 /* Widget.h in Headers */,
93378D01252B4F550077D2D8 /* JsonFwd.hpp in Headers */,
C6352B851F477022006CCEE3 /* DataSerialiserTraits.h in Headers */,
93DFD05124521C1A001FCBAF /* ScContext.hpp in Headers */,
939A359F20C12FDE00630B3F /* Paint.Surface.h in Headers */,
@@ -3686,6 +3693,7 @@
93DFD04A24521C1A001FCBAF /* ScConfiguration.hpp in Headers */,
93CBA4CC20A7504500867D56 /* ImageImporter.h in Headers */,
2ADE2F29224418B2002598AF /* Numerics.hpp in Headers */,
93378D03252B54140077D2D8 /* json_fwd.hpp in Headers */,
93DFD04924521C1A001FCBAF /* ScTile.hpp in Headers */,
936F412B24CE030F00E07BCF /* NetworkBase.h in Headers */,
93DFD04524521C1A001FCBAF /* ScObject.hpp in Headers */,
@@ -3889,7 +3897,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "version=\"25\"\nzipname=\"openrct2-libs-v25-x64-macos-dylibs.zip\"\nliburl=\"https://github.com/OpenRCT2/Dependencies/releases/download/v$version/$zipname\"\n\n[[ ! -d \"${SRCROOT}/libxc\" || ! -e \"${SRCROOT}/libversion\" || $(head -n 1 \"${SRCROOT}/libversion\") != $version ]]\noutdated=$?\n\nif [[ $outdated -eq 0 ]]; then\nif [[ -d \"${SRCROOT}/libxc\" ]]; then rm -r \"${SRCROOT}/libxc\"; fi\nmkdir \"${SRCROOT}/libxc\"\n\ncurl -L -o \"${SRCROOT}/libxc/$zipname\" \"$liburl\"\nunzip -uaq -d \"${SRCROOT}/libxc\" \"${SRCROOT}/libxc/$zipname\"\nrm \"${SRCROOT}/libxc/$zipname\"\n\necho $version > \"${SRCROOT}/libversion\"\nfi\n";
shellScript = "version=\"26\"\nzipname=\"openrct2-libs-v26-x64-macos-dylibs.zip\"\nliburl=\"https://github.com/OpenRCT2/Dependencies/releases/download/v$version/$zipname\"\n\n[[ ! -d \"${SRCROOT}/libxc\" || ! -e \"${SRCROOT}/libversion\" || $(head -n 1 \"${SRCROOT}/libversion\") != $version ]]\noutdated=$?\n\nif [[ $outdated -eq 0 ]]; then\nif [[ -d \"${SRCROOT}/libxc\" ]]; then rm -r \"${SRCROOT}/libxc\"; fi\nmkdir \"${SRCROOT}/libxc\"\n\ncurl -L -o \"${SRCROOT}/libxc/$zipname\" \"$liburl\"\nunzip -uaq -d \"${SRCROOT}/libxc\" \"${SRCROOT}/libxc/$zipname\"\nrm \"${SRCROOT}/libxc/$zipname\"\n\necho $version > \"${SRCROOT}/libversion\"\nfi\n";
};
D42C09D21C254F4E00309751 /* Build g2.dat */ = {
isa = PBXShellScriptBuildPhase;

View File

@@ -0,0 +1,14 @@
/*****************************************************************************
* Copyright (c) 2014-2020 OpenRCT2 developers
*
* For a complete list of all authors, please refer to contributors.md
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
*
* OpenRCT2 is licensed under the GNU General Public License version 3.
*****************************************************************************/
#pragma once
#include <nlohmann/json_fwd.hpp>
using json_t = nlohmann::json;

View File

@@ -14,6 +14,7 @@
#include <algorithm>
#include <cmath>
#include <unordered_map>
rct_colour_map ColourMapA[COLOUR_COUNT] = {};

View File

@@ -169,6 +169,7 @@
<ClInclude Include="core\IStream.hpp" />
<ClInclude Include="core\JobPool.hpp" />
<ClInclude Include="core\Json.hpp" />
<ClInclude Include="core\JsonFwd.hpp" />
<ClInclude Include="core\Memory.hpp" />
<ClInclude Include="core\MemoryStream.h" />
<ClInclude Include="core\Meta.hpp" />

View File

@@ -18,6 +18,7 @@
#include "../actions/NetworkModifyGroupAction.hpp"
#include "../actions/PeepPickupAction.hpp"
#include "../core/Guard.hpp"
#include "../core/Json.hpp"
#include "../platform/Platform2.h"
#include "../scripting/ScriptEngine.h"
#include "../ui/UiContext.h"
@@ -52,7 +53,6 @@ static constexpr uint32_t CHUNK_SIZE = 1024 * 63;
# include "../config/Config.h"
# include "../core/Console.hpp"
# include "../core/FileStream.hpp"
# include "../core/Json.hpp"
# include "../core/MemoryStream.h"
# include "../core/Nullable.hpp"
# include "../core/Path.hpp"

View File

@@ -1,7 +1,6 @@
#pragma once
#include "../actions/GameAction.h"
#include "../core/Json.hpp"
#include "NetworkConnection.h"
#include "NetworkGroup.h"
#include "NetworkPlayer.h"

View File

@@ -11,6 +11,7 @@
# include "NetworkGroup.h"
# include "../openrct2/core/Json.hpp"
# include "NetworkAction.h"
# include "NetworkTypes.h"

View File

@@ -10,7 +10,6 @@
#pragma once
#include "../common.h"
#include "../core/Json.hpp"
#include "NetworkPacket.h"
#include <array>

View File

@@ -13,6 +13,7 @@
# include "../core/Console.hpp"
# include "../core/Guard.hpp"
# include "../core/Json.hpp"
# include "../core/Path.hpp"
# include "../core/String.hpp"
# include "../platform/Platform2.h"

View File

@@ -10,7 +10,7 @@
#pragma once
#include "../common.h"
#include "../core/Json.hpp"
#include "../core/JsonFwd.hpp"
#include "../core/Nullable.hpp"
#include <map>

View File

@@ -10,7 +10,7 @@
#pragma once
#include "../common.h"
#include "../core/Json.hpp"
#include "../core/JsonFwd.hpp"
#include <future>
#include <optional>

View File

@@ -15,7 +15,7 @@
#define MAX_SERVER_DESCRIPTION_LENGTH 256
#include "../common.h"
#include "../core/Json.hpp"
#include "../core/JsonFwd.hpp"
#include "../localisation/StringIds.h"
#include "NetworkTypes.h"

View File

@@ -10,6 +10,7 @@
#include "BannerObject.h"
#include "../core/IStream.hpp"
#include "../core/Json.hpp"
#include "../drawing/Drawing.h"
#include "../localisation/Language.h"
#include "../object/Object.h"

View File

@@ -10,6 +10,7 @@
#include "EntranceObject.h"
#include "../core/IStream.hpp"
#include "../core/Json.hpp"
#include "../core/String.hpp"
#include "../drawing/Drawing.h"
#include "../localisation/Localisation.h"

View File

@@ -10,6 +10,7 @@
#include "FootpathItemObject.h"
#include "../core/IStream.hpp"
#include "../core/Json.hpp"
#include "../drawing/Drawing.h"
#include "../interface/Cursors.h"
#include "../localisation/Localisation.h"

View File

@@ -15,6 +15,7 @@
#include "../core/File.h"
#include "../core/FileScanner.h"
#include "../core/IStream.hpp"
#include "../core/Json.hpp"
#include "../core/Path.hpp"
#include "../core/String.hpp"
#include "../drawing/ImageImporter.h"

View File

@@ -10,7 +10,7 @@
#pragma once
#include "../common.h"
#include "../core/Json.hpp"
#include "../core/JsonFwd.hpp"
#include "../drawing/Drawing.h"
#include <memory>

View File

@@ -10,7 +10,7 @@
#pragma once
#include "../common.h"
#include "../core/Json.hpp"
#include "../core/JsonFwd.hpp"
#include "ImageTable.h"
#include "StringTable.h"

View File

@@ -14,6 +14,7 @@
#include "../OpenRCT2.h"
#include "../audio/audio.h"
#include "../core/IStream.hpp"
#include "../core/Json.hpp"
#include "../core/Memory.hpp"
#include "../core/String.hpp"
#include "../drawing/Drawing.h"

View File

@@ -10,7 +10,6 @@
#pragma once
#include "../core/IStream.hpp"
#include "../core/Json.hpp"
#include "../ride/Ride.h"
#include "Object.h"

View File

@@ -13,6 +13,7 @@
#include "../Context.h"
#include "../core/IStream.hpp"
#include "../core/Json.hpp"
#include "../core/Memory.hpp"
#include "../core/String.hpp"
#include "../drawing/Drawing.h"

View File

@@ -12,6 +12,7 @@
#include "SmallSceneryObject.h"
#include "../core/IStream.hpp"
#include "../core/Json.hpp"
#include "../core/Memory.hpp"
#include "../core/String.hpp"
#include "../drawing/Drawing.h"

View File

@@ -10,6 +10,7 @@
#include "StationObject.h"
#include "../core/IStream.hpp"
#include "../core/Json.hpp"
#include "../core/String.hpp"
#include "../drawing/Drawing.h"
#include "../localisation/Localisation.h"

View File

@@ -10,6 +10,7 @@
#include "StringTable.h"
#include "../core/IStream.hpp"
#include "../core/Json.hpp"
#include "../core/String.hpp"
#include "../localisation/Language.h"
#include "../localisation/LanguagePack.h"

View File

@@ -10,7 +10,7 @@
#pragma once
#include "../common.h"
#include "../core/Json.hpp"
#include "../core/JsonFwd.hpp"
#include "../localisation/Language.h"
#include <string>

View File

@@ -10,6 +10,7 @@
#include "TerrainEdgeObject.h"
#include "../core/IStream.hpp"
#include "../core/Json.hpp"
#include "../core/String.hpp"
#include "../drawing/Drawing.h"
#include "../localisation/Localisation.h"

View File

@@ -12,6 +12,7 @@
#include "TerrainSurfaceObject.h"
#include "../core/IStream.hpp"
#include "../core/Json.hpp"
#include "../core/String.hpp"
#include "../drawing/Drawing.h"
#include "../localisation/Localisation.h"

View File

@@ -10,6 +10,7 @@
#include "WallObject.h"
#include "../core/IStream.hpp"
#include "../core/Json.hpp"
#include "../core/String.hpp"
#include "../drawing/Drawing.h"
#include "../interface/Cursors.h"

View File

@@ -13,6 +13,7 @@
#include "../OpenRCT2.h"
#include "../core/IStream.hpp"
#include "../core/Json.hpp"
#include "../localisation/Language.h"
#include "../localisation/StringIds.h"
#include "../world/Location.hpp"