From c23d8f64bc39bc55e2abd4e0bef0e4d7c747a547 Mon Sep 17 00:00:00 2001 From: AnyOldName3 Date: Wed, 24 Dec 2025 01:34:56 +0000 Subject: [PATCH] Disable multithreaded codegen for hungry TUs --- apps/openmw/CMakeLists.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index 8570d9df60..22956bf00f 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -123,6 +123,19 @@ add_library(openmw-lib STATIC ${OPENMW_SOURCES} ) +if (MSVC) + # these TUs take a lot of memory for codegen + # in CI, they often go over the 8GB memory limit if another cl.exe is running at the same time + # this option (make sure you're not looking at the docs for the identically-named linker option) stops four codegen threads being spun off + # it hurts build time ~33% to enable this unnecessarily, though, so target it to the hungriest boys + set_source_files_properties( + options.cpp + mwlua/stats.cpp + PROPERTIES + COMPILE_OPTIONS /cgthreads1 + ) +endif() + if(BUILD_OPENMW) if (ANDROID) add_library(openmw SHARED