From 42865d8d62299de420049583605989c673924bfe Mon Sep 17 00:00:00 2001 From: Eddoursul Date: Sat, 12 Sep 2026 00:42:47 +0200 Subject: [PATCH] Build the DLL with /MT --- source/Enderal DLL/CMakeLists.txt | 10 ++++++---- source/Steam DLL/CMakeLists.txt | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/source/Enderal DLL/CMakeLists.txt b/source/Enderal DLL/CMakeLists.txt index 9d26d65e8..180e7fd22 100644 --- a/source/Enderal DLL/CMakeLists.txt +++ b/source/Enderal DLL/CMakeLists.txt @@ -35,10 +35,12 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) # Link-time optimization for release builds only (debug builds stay fast). set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE ON) -# CommonLibSSE-NG requires the dynamic CRT. Dependencies used to be supplied by -# vcpkg (which set this via a preset); now that they come from FetchContent we -# set it here so both build.cmd and Visual Studio "Open Folder" pick it up. -set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>DLL") +# Static CRT: the plugin must not depend on the user's VC Redist version. The MSVC STL +# requires msvcp140.dll to be at least as new as the toolset that built the plugin, so a +# /MD build crashes on load against an outdated redistributable. All dependencies build +# from source under this setting; CommonLibSSE-GG's prebuilt bundle is /MD only and is +# skipped automatically. +set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") add_compile_definitions(NOMINMAX _USE_MATH_DEFINES WIN32_LEAN_AND_MEAN) add_definitions(-DUNICODE -D_UNICODE) diff --git a/source/Steam DLL/CMakeLists.txt b/source/Steam DLL/CMakeLists.txt index 547fcc1c9..cd33e57d5 100644 --- a/source/Steam DLL/CMakeLists.txt +++ b/source/Steam DLL/CMakeLists.txt @@ -36,10 +36,12 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) # Link-time optimization for release builds only (debug builds stay fast). set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE ON) -# CommonLibSSE-NG requires the dynamic CRT. Dependencies used to be supplied by -# vcpkg (which set this via a preset); now that they come from FetchContent we -# set it here so both build.cmd and Visual Studio "Open Folder" pick it up. -set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>DLL") +# Static CRT: the plugin must not depend on the user's VC Redist version. The MSVC STL +# requires msvcp140.dll to be at least as new as the toolset that built the plugin, so a +# /MD build crashes on load against an outdated redistributable. All dependencies build +# from source under this setting; CommonLibSSE-GG's prebuilt bundle is /MD only and is +# skipped automatically. +set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") add_compile_definitions(NOMINMAX _USE_MATH_DEFINES WIN32_LEAN_AND_MEAN) add_definitions(-DUNICODE -D_UNICODE)