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