From d809a9f633f7b8adbf893f0b60f69b58161e1037 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Sun, 14 May 2023 02:10:17 +0200 Subject: [PATCH] Use PCH generated from VPC globally This reduced output code size with 40KiB, improved compile times and appeared to improve runtime performance as well. --- r5dev/appframework/CMakeLists.txt | 2 +- r5dev/codecs/CMakeLists.txt | 2 +- r5dev/datacache/CMakeLists.txt | 2 +- r5dev/ebisusdk/CMakeLists.txt | 2 +- r5dev/filesystem/CMakeLists.txt | 2 +- r5dev/gameui/CMakeLists.txt | 2 +- r5dev/tier0/CMakeLists.txt | 4 +--- r5dev/tier0/binstream.cpp | 1 - r5dev/tier0/commandline.cpp | 1 - r5dev/tier0/cpu.cpp | 1 - r5dev/tier0/cputopology.cpp | 2 -- r5dev/tier0/crashhandler.cpp | 1 - r5dev/tier0/dbg.cpp | 1 - r5dev/tier0/fasttimer.cpp | 1 - r5dev/tier0/frametask.cpp | 1 - r5dev/tier0/jobthread.cpp | 1 - r5dev/tier0/memaddr.cpp | 1 - r5dev/tier0/module.cpp | 1 - r5dev/tier0/platform.cpp | 1 - r5dev/tier0/sigcache.cpp | 1 - r5dev/tier0/threadtools.cpp | 1 - r5dev/tier0/tier0_pch.h | 31 ------------------------------- r5dev/tier0/utility.cpp | 1 - r5dev/tier0/vtable.cpp | 1 - r5dev/tier1/CMakeLists.txt | 2 +- r5dev/tier1/NetAdr.cpp | 1 - r5dev/tier1/NetKey.cpp | 1 - r5dev/tier1/bitbuf.cpp | 1 - r5dev/tier1/characterset.cpp | 1 - r5dev/tier1/cmd.cpp | 1 - r5dev/tier1/cvar.cpp | 1 - r5dev/tier1/generichash.cpp | 1 - r5dev/tier1/lzss.cpp | 1 - r5dev/tier1/memstack.cpp | 1 - r5dev/tier1/splitstring.cpp | 1 - r5dev/tier1/stringpool.cpp | 1 - r5dev/tier1/strtools.cpp | 1 - r5dev/tier1/utlbuffer.cpp | 1 - r5dev/tier1/utlstring.cpp | 1 - r5dev/tier2/CMakeLists.txt | 2 +- r5dev/tier2/renderutils.cpp | 1 - 41 files changed, 9 insertions(+), 74 deletions(-) delete mode 100644 r5dev/tier0/tier0_pch.h diff --git a/r5dev/appframework/CMakeLists.txt b/r5dev/appframework/CMakeLists.txt index a3607f9c..f70fb886 100644 --- a/r5dev/appframework/CMakeLists.txt +++ b/r5dev/appframework/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required( VERSION 3.16 ) -add_module( "lib" "appframework" "tier0" ${FOLDER_CONTEXT} ) +add_module( "lib" "appframework" "vpc" ${FOLDER_CONTEXT} ) start_sources() diff --git a/r5dev/codecs/CMakeLists.txt b/r5dev/codecs/CMakeLists.txt index 5454dd5c..6be341c2 100644 --- a/r5dev/codecs/CMakeLists.txt +++ b/r5dev/codecs/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required( VERSION 3.16 ) -add_module( "lib" "codecs" "tier0" ${FOLDER_CONTEXT} ) +add_module( "lib" "codecs" "vpc" ${FOLDER_CONTEXT} ) start_sources() diff --git a/r5dev/datacache/CMakeLists.txt b/r5dev/datacache/CMakeLists.txt index f00f19dd..b8a7ca34 100644 --- a/r5dev/datacache/CMakeLists.txt +++ b/r5dev/datacache/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required( VERSION 3.16 ) -add_module( "lib" "datacache" "tier0" ${FOLDER_CONTEXT} ) +add_module( "lib" "datacache" "vpc" ${FOLDER_CONTEXT} ) start_sources() diff --git a/r5dev/ebisusdk/CMakeLists.txt b/r5dev/ebisusdk/CMakeLists.txt index 46b5b35b..2cbce379 100644 --- a/r5dev/ebisusdk/CMakeLists.txt +++ b/r5dev/ebisusdk/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required( VERSION 3.16 ) -add_module( "lib" "EbisuSDK" "tier0" ${FOLDER_CONTEXT} ) +add_module( "lib" "EbisuSDK" "vpc" ${FOLDER_CONTEXT} ) start_sources() diff --git a/r5dev/filesystem/CMakeLists.txt b/r5dev/filesystem/CMakeLists.txt index 67b81271..3ec6bc65 100644 --- a/r5dev/filesystem/CMakeLists.txt +++ b/r5dev/filesystem/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required( VERSION 3.16 ) -add_module( "lib" "filesystem" "tier0" ${FOLDER_CONTEXT} ) +add_module( "lib" "filesystem" "vpc" ${FOLDER_CONTEXT} ) start_sources() diff --git a/r5dev/gameui/CMakeLists.txt b/r5dev/gameui/CMakeLists.txt index 05764f98..ccc78290 100644 --- a/r5dev/gameui/CMakeLists.txt +++ b/r5dev/gameui/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required( VERSION 3.16 ) -add_module( "lib" "gameui" "tier0" ${FOLDER_CONTEXT} ) +add_module( "lib" "gameui" "vpc" ${FOLDER_CONTEXT} ) start_sources() diff --git a/r5dev/tier0/CMakeLists.txt b/r5dev/tier0/CMakeLists.txt index 8b6d3d7f..8f58381d 100644 --- a/r5dev/tier0/CMakeLists.txt +++ b/r5dev/tier0/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required( VERSION 3.16 ) -add_module( "lib" "tier0" "" ${FOLDER_CONTEXT} ) +add_module( "lib" "tier0" "vpc" ${FOLDER_CONTEXT} ) start_sources() @@ -29,7 +29,6 @@ add_sources( SOURCE_GROUP "Runtime" "threadtools.cpp" "tslist.cpp" "vtable.cpp" - "tier0_pch.h" "tier0_iface.cpp" "utility.cpp" "binstream.cpp" @@ -65,4 +64,3 @@ add_sources( SOURCE_GROUP "Public" ) end_sources() -target_precompile_headers( ${PROJECT_NAME} PRIVATE tier0_pch.h ) diff --git a/r5dev/tier0/binstream.cpp b/r5dev/tier0/binstream.cpp index b62bd391..405a5c96 100644 --- a/r5dev/tier0/binstream.cpp +++ b/r5dev/tier0/binstream.cpp @@ -1,4 +1,3 @@ -#include "tier0_pch.h" #include "tier0/binstream.h" //----------------------------------------------------------------------------- diff --git a/r5dev/tier0/commandline.cpp b/r5dev/tier0/commandline.cpp index 5ce60ca6..a66138dc 100644 --- a/r5dev/tier0/commandline.cpp +++ b/r5dev/tier0/commandline.cpp @@ -4,7 +4,6 @@ // //=============================================================================// -#include "tier0_pch.h" #include "tier0/commandline.h" #include "tier1/cvar.h" diff --git a/r5dev/tier0/cpu.cpp b/r5dev/tier0/cpu.cpp index 790fea2b..167d14d3 100644 --- a/r5dev/tier0/cpu.cpp +++ b/r5dev/tier0/cpu.cpp @@ -4,7 +4,6 @@ // // $NoKeywords: $ //=============================================================================// -#include "tier0_pch.h" #include "tier0/cpu.h" #include "tier0/cputopology.h" #include "tier0/fasttimer.h" diff --git a/r5dev/tier0/cputopology.cpp b/r5dev/tier0/cputopology.cpp index 1c6091a5..8769e3cd 100644 --- a/r5dev/tier0/cputopology.cpp +++ b/r5dev/tier0/cputopology.cpp @@ -5,8 +5,6 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. //------------------------------------------------------------------------------------- -#include "tier0_pch.h" - #if defined(_WIN32) && !defined(_X360) && !defined(_PS3) #include "tier0/cputopology.h" diff --git a/r5dev/tier0/crashhandler.cpp b/r5dev/tier0/crashhandler.cpp index e5995fa5..4d552d03 100644 --- a/r5dev/tier0/crashhandler.cpp +++ b/r5dev/tier0/crashhandler.cpp @@ -3,7 +3,6 @@ // Purpose: Crash handler (overrides the game's implementation!) // //=============================================================================// -#include "tier0_pch.h" #include "tier0/binstream.h" #include "tier0/cpu.h" #include "tier0/crashhandler.h" diff --git a/r5dev/tier0/dbg.cpp b/r5dev/tier0/dbg.cpp index 18758970..f0787a44 100644 --- a/r5dev/tier0/dbg.cpp +++ b/r5dev/tier0/dbg.cpp @@ -6,7 +6,6 @@ // //===========================================================================// -#include "tier0_pch.h" #include "tier0/dbg.h" #include "tier0/platform.h" #ifndef NETCONSOLE diff --git a/r5dev/tier0/fasttimer.cpp b/r5dev/tier0/fasttimer.cpp index f2c62143..69a27b05 100644 --- a/r5dev/tier0/fasttimer.cpp +++ b/r5dev/tier0/fasttimer.cpp @@ -5,7 +5,6 @@ // $NoKeywords: $ //=============================================================================// -#include "tier0_pch.h" #include "tier0/fasttimer.h" // Constructor init the clock speed. diff --git a/r5dev/tier0/frametask.cpp b/r5dev/tier0/frametask.cpp index 208a7323..899f0cda 100644 --- a/r5dev/tier0/frametask.cpp +++ b/r5dev/tier0/frametask.cpp @@ -5,7 +5,6 @@ //----------------------------------------------------------------------------- // //=============================================================================// -#include "tier0_pch.h" #include "tier0/frametask.h" //----------------------------------------------------------------------------- diff --git a/r5dev/tier0/jobthread.cpp b/r5dev/tier0/jobthread.cpp index c81759f6..b17a8fc4 100644 --- a/r5dev/tier0/jobthread.cpp +++ b/r5dev/tier0/jobthread.cpp @@ -1,5 +1,4 @@ -#include "tier0_pch.h" #include "engine/host_cmd.h" #include "tier0/jobthread.h" diff --git a/r5dev/tier0/memaddr.cpp b/r5dev/tier0/memaddr.cpp index 7390c324..75343a59 100644 --- a/r5dev/tier0/memaddr.cpp +++ b/r5dev/tier0/memaddr.cpp @@ -3,7 +3,6 @@ // Purpose: Implementation of the CMemory class. // //===========================================================================// -#include "tier0_pch.h" #include "tier0/memaddr.h" //----------------------------------------------------------------------------- diff --git a/r5dev/tier0/module.cpp b/r5dev/tier0/module.cpp index c6842d6c..b9f06b83 100644 --- a/r5dev/tier0/module.cpp +++ b/r5dev/tier0/module.cpp @@ -3,7 +3,6 @@ // Purpose: Implementation of the CModule class. // //===========================================================================// -#include "tier0_pch.h" #include "tier0/memaddr.h" #include "tier0/sigcache.h" diff --git a/r5dev/tier0/platform.cpp b/r5dev/tier0/platform.cpp index bbefb30d..9de984d3 100644 --- a/r5dev/tier0/platform.cpp +++ b/r5dev/tier0/platform.cpp @@ -1,4 +1,3 @@ -#include "tier0_pch.h" #include "tier0/platform_internal.h" //----------------------------------------------------------------------------- diff --git a/r5dev/tier0/sigcache.cpp b/r5dev/tier0/sigcache.cpp index 9b965255..0570afc5 100644 --- a/r5dev/tier0/sigcache.cpp +++ b/r5dev/tier0/sigcache.cpp @@ -16,7 +16,6 @@ // searching for each signature in the memory region of the target executable. // /////////////////////////////////////////////////////////////////////////////// -#include "tier0_pch.h" #include "tier0/sigcache.h" #include "tier0/binstream.h" diff --git a/r5dev/tier0/threadtools.cpp b/r5dev/tier0/threadtools.cpp index 1dda2002..01b0a6be 100644 --- a/r5dev/tier0/threadtools.cpp +++ b/r5dev/tier0/threadtools.cpp @@ -6,7 +6,6 @@ // $NoKeywords: $ //===========================================================================// -#include "tier0_pch.h" #include "tier0/threadtools.h" int32 ThreadInterlockedCompareExchange(LONG volatile* pDest, int32 value, int32 comperand) diff --git a/r5dev/tier0/tier0_pch.h b/r5dev/tier0/tier0_pch.h deleted file mode 100644 index a2f74356..00000000 --- a/r5dev/tier0/tier0_pch.h +++ /dev/null @@ -1,31 +0,0 @@ -//===========================================================================// -// -// Purpose: Tier0 precompiled header file. -// -//===========================================================================// -#ifndef TIER0_PCH_H -#define TIER0_PCH_H - -#include "core/shared_pch.h" - -#include "thirdparty/detours/include/detours.h" -#include "thirdparty/detours/include/idetour.h" - -#include "thirdparty/lzham/include/lzham_assert.h" -#include "thirdparty/lzham/include/lzham_types.h" -#include "thirdparty/lzham/include/lzham.h" - -#include "thirdparty/curl/include/curl/curl.h" - -#include "tier0/utility.h" -#include "tier0/memaddr.h" -#include "tier0/module.h" -#include "tier0/basetypes.h" -#include "tier0/platform.h" -#include "tier0/annotations.h" -#include "tier0/commonmacros.h" -#include "tier0/memalloc.h" -#include "tier0/tier0_iface.h" -#include "tier0/dbg.h" - -#endif // TIER0_PCH_H diff --git a/r5dev/tier0/utility.cpp b/r5dev/tier0/utility.cpp index c72742ea..cb2b7a7b 100644 --- a/r5dev/tier0/utility.cpp +++ b/r5dev/tier0/utility.cpp @@ -2,7 +2,6 @@ * _utility *-----------------------------------------------------------------------------*/ -#include "tier0_pch.h" #include "core/logdef.h" #include "tier0/utility.h" diff --git a/r5dev/tier0/vtable.cpp b/r5dev/tier0/vtable.cpp index 999c8fbe..196f9485 100644 --- a/r5dev/tier0/vtable.cpp +++ b/r5dev/tier0/vtable.cpp @@ -5,7 +5,6 @@ // DO NOT USE FOR SHIPPING CODE!!!!!!!!!! // //===========================================================================// -#include "tier0_pch.h" #include "tier0/vtable.h" //----------------------------------------------------------------------------- diff --git a/r5dev/tier1/CMakeLists.txt b/r5dev/tier1/CMakeLists.txt index 7fbe1c68..b5b48ab5 100644 --- a/r5dev/tier1/CMakeLists.txt +++ b/r5dev/tier1/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required( VERSION 3.16 ) -add_module( "lib" "tier1" "tier0" ${FOLDER_CONTEXT} ) +add_module( "lib" "tier1" "vpc" ${FOLDER_CONTEXT} ) start_sources() diff --git a/r5dev/tier1/NetAdr.cpp b/r5dev/tier1/NetAdr.cpp index 7c5f3089..9618695f 100644 --- a/r5dev/tier1/NetAdr.cpp +++ b/r5dev/tier1/NetAdr.cpp @@ -4,7 +4,6 @@ // -------------------------------------------------------------------------- //===========================================================================// -#include "tier0_pch.h" #include "tier1/NetAdr.h" #include "tier1/strtools.h" diff --git a/r5dev/tier1/NetKey.cpp b/r5dev/tier1/NetKey.cpp index 55281a6b..38bdf48f 100644 --- a/r5dev/tier1/NetKey.cpp +++ b/r5dev/tier1/NetKey.cpp @@ -3,7 +3,6 @@ // Purpose: implementation of the CNetKey class. // -------------------------------------------------------------------------- //===========================================================================// -#include "tier0_pch.h" #include "tier1/NetKey.h" ////////////////////////////////////////////////////////////////////// diff --git a/r5dev/tier1/bitbuf.cpp b/r5dev/tier1/bitbuf.cpp index f194a88b..b3cf7692 100644 --- a/r5dev/tier1/bitbuf.cpp +++ b/r5dev/tier1/bitbuf.cpp @@ -5,7 +5,6 @@ // $NoKeywords: $ //===========================================================================// -#include "tier0_pch.h" #include "tier1/bitbuf.h" #include "mathlib/swap.h" #include "mathlib/bitvec.h" diff --git a/r5dev/tier1/characterset.cpp b/r5dev/tier1/characterset.cpp index 1b13a1c9..e1d49c03 100644 --- a/r5dev/tier1/characterset.cpp +++ b/r5dev/tier1/characterset.cpp @@ -11,7 +11,6 @@ // $NoKeywords: $ //============================================================================= -#include "tier0_pch.h" #include "tier1/characterset.h" // memdbgon must be the last include file in a .cpp file!!! diff --git a/r5dev/tier1/cmd.cpp b/r5dev/tier1/cmd.cpp index 4ee5e7e6..ba7b7664 100644 --- a/r5dev/tier1/cmd.cpp +++ b/r5dev/tier1/cmd.cpp @@ -4,7 +4,6 @@ // //=============================================================================// -#include "tier0_pch.h" #include "tier0/tslist.h" #include "tier0/memstd.h" #include "tier0/commandline.h" diff --git a/r5dev/tier1/cvar.cpp b/r5dev/tier1/cvar.cpp index 9a4aeab1..93833676 100644 --- a/r5dev/tier1/cvar.cpp +++ b/r5dev/tier1/cvar.cpp @@ -1,4 +1,3 @@ -#include "tier0_pch.h" #include "tier1/utlrbtree.h" #include "tier1/NetAdr.h" #include "tier1/cvar.h" diff --git a/r5dev/tier1/generichash.cpp b/r5dev/tier1/generichash.cpp index c3d5d737..87cd0558 100644 --- a/r5dev/tier1/generichash.cpp +++ b/r5dev/tier1/generichash.cpp @@ -5,7 +5,6 @@ // //============================================================================= -#include "tier0_pch.h" #include "tier0/dbg.h" #include "tier0/basetypes.h" #include "tier0/platform.h" diff --git a/r5dev/tier1/lzss.cpp b/r5dev/tier1/lzss.cpp index b80046af..590c29ab 100644 --- a/r5dev/tier1/lzss.cpp +++ b/r5dev/tier1/lzss.cpp @@ -5,7 +5,6 @@ // //=====================================================================================// -#include "tier0_pch.h" #include "tier0/platform.h" #include "tier0/dbg.h" #include "tier1/lzss.h" diff --git a/r5dev/tier1/memstack.cpp b/r5dev/tier1/memstack.cpp index 35a53e30..a8508b4b 100644 --- a/r5dev/tier1/memstack.cpp +++ b/r5dev/tier1/memstack.cpp @@ -4,7 +4,6 @@ // //=============================================================================// -#include "tier0_pch.h" #include "tier0/dbg.h" #include "tier0/memstd.h" #include "tier1/memstack.h" diff --git a/r5dev/tier1/splitstring.cpp b/r5dev/tier1/splitstring.cpp index a813829a..c74b78e9 100644 --- a/r5dev/tier1/splitstring.cpp +++ b/r5dev/tier1/splitstring.cpp @@ -4,7 +4,6 @@ // //================================================================================================== -#include "tier0_pch.h" #include "tier1/strtools.h" #include "tier1/utlvector.h" diff --git a/r5dev/tier1/stringpool.cpp b/r5dev/tier1/stringpool.cpp index 91ef49e2..a3063dd9 100644 --- a/r5dev/tier1/stringpool.cpp +++ b/r5dev/tier1/stringpool.cpp @@ -5,7 +5,6 @@ // $NoKeywords: $ //===========================================================================// -#include "tier0_pch.h" #include "tier0/dbg.h" #include "tier1/strtools.h" #include "tier1/stringpool.h" diff --git a/r5dev/tier1/strtools.cpp b/r5dev/tier1/strtools.cpp index b7fd9139..db76b12e 100644 --- a/r5dev/tier1/strtools.cpp +++ b/r5dev/tier1/strtools.cpp @@ -1,4 +1,3 @@ -#include "tier0_pch.h" #include "tier1/strtools.h" FORCEINLINE unsigned char tolower_fast(unsigned char c) diff --git a/r5dev/tier1/utlbuffer.cpp b/r5dev/tier1/utlbuffer.cpp index 221c0782..3d62423e 100644 --- a/r5dev/tier1/utlbuffer.cpp +++ b/r5dev/tier1/utlbuffer.cpp @@ -8,7 +8,6 @@ #pragma warning (disable : 4514) -#include "tier0_pch.h" #include "tier1/utlbuffer.h" #include "tier1/strtools.h" #include "tier1/characterset.h" diff --git a/r5dev/tier1/utlstring.cpp b/r5dev/tier1/utlstring.cpp index 4354129e..6cd7fcc7 100644 --- a/r5dev/tier1/utlstring.cpp +++ b/r5dev/tier1/utlstring.cpp @@ -4,7 +4,6 @@ // //============================================================================= -#include "tier0_pch.h" #include "tier1/utlstring.h" #include "tier1/utlvector.h" #include "tier1/strtools.h" diff --git a/r5dev/tier2/CMakeLists.txt b/r5dev/tier2/CMakeLists.txt index 55554aa8..d79b497f 100644 --- a/r5dev/tier2/CMakeLists.txt +++ b/r5dev/tier2/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required( VERSION 3.16 ) -add_module( "lib" "tier2" "tier0" ${FOLDER_CONTEXT} ) +add_module( "lib" "tier2" "vpc" ${FOLDER_CONTEXT} ) start_sources() diff --git a/r5dev/tier2/renderutils.cpp b/r5dev/tier2/renderutils.cpp index 20c59773..7f0dd093 100644 --- a/r5dev/tier2/renderutils.cpp +++ b/r5dev/tier2/renderutils.cpp @@ -6,7 +6,6 @@ // /////////////////////////////////////////////////////////////////////////////// -#include "tier0_pch.h" #include "mathlib/color.h" #include "mathlib/vector.h" #include "mathlib/vector2d.h"