Build the DLL with /MT

This commit is contained in:
Eddoursul 2026-09-12 00:42:47 +02:00
parent 35af9226ed
commit 42865d8d62
2 changed files with 12 additions and 8 deletions

View File

@ -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$<$<CONFIG:Debug>: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$<$<CONFIG:Debug>:Debug>")
add_compile_definitions(NOMINMAX _USE_MATH_DEFINES WIN32_LEAN_AND_MEAN)
add_definitions(-DUNICODE -D_UNICODE)

View File

@ -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$<$<CONFIG:Debug>: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$<$<CONFIG:Debug>:Debug>")
add_compile_definitions(NOMINMAX _USE_MATH_DEFINES WIN32_LEAN_AND_MEAN)
add_definitions(-DUNICODE -D_UNICODE)