Skip to content

Commit ae93dc6

Browse files
authored
CMake unity build (#1982)
* Improve compile times, no ccache full compile (these are just sample times to give a rough idea of the speedups, it can varies): * Linux debug 9800x3d: 1m13s to 23s (3.2x speedup) * Linux release 9800x3d: 1m36s to 1m21s (1.2x speedup) * Windows debug 9800x3d: 1m21s to 14s (4.7x speedup) * Windows release 9800x3d: 1m24s to 18s (4.6x speedup) * Time VS in CMake library build stage: https://github.com/NeotokyoRebuild/neo/actions/runs/27134842462 (non-unity) VS https://github.com/NeotokyoRebuild/neo/actions/runs/27227387768 (unity) * Linux debug github runner: 12m16s to 2m6s (5.8x speedup) | Total down from 16m16s to 5m27s * Linux release github runner: 14m3s to 4m57s (2.8x speedup) | Total down from 18m16s to 9m41s * Windows debug github runner: 10m56s to 1m24s (7.8x speedup) | Total down from 14m17s to 4m58s * Windows release github runner: 11m22s to 2m38s (4.3x speedup) | Total down from 14m45s to 6m5s * Lots of files not unity build due to IInput vs vgui::IInput ambiguity * Some files left out cause easier to leave it out than dealing with it * Not doing materialsystem as it .inc relies on 1-file-per-obj * Few files left out of unity due to issues shown up in runtime * Object/compilation units from 1.4k to ~166 * fixes #1981
1 parent 95432de commit ae93dc6

68 files changed

Lines changed: 1778 additions & 889 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ set(CMAKE_VERBOSE_MAKEFILE TRUE)
77
message(STATUS "CMAKE_VERSION: ${CMAKE_VERSION}")
88

99
string(TIMESTAMP BUILD_DATETIME UTC)
10-
message(STATUS "TIMESTAMP: ${BUILD_DATETIME}")
10+
# NEO TODO (nullsystem): This screwed up nvim's :make
11+
# message(STATUS "TIMESTAMP: ${BUILD_DATETIME}")
1112

1213
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
1314

@@ -179,6 +180,7 @@ if(OS_WINDOWS)
179180
/errorReport:prompt # ErrorReporting - Prompt Immediately
180181
/W4
181182
/Gw # Optimize Global Data
183+
/bigobj # Required for unity build
182184

183185
/wd4456
184186
/wd4457

0 commit comments

Comments
 (0)