Skip to content

Commit d4fa951

Browse files
committed
fix: set MSVC runtime library before FetchContent
The runtime library setting must be applied before FetchContent to ensure all dependencies (FTXUI, httplib, json) use the same dynamic runtime (/MD).
1 parent f6d7b8c commit d4fa951

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ set(CMAKE_CXX_STANDARD 17)
55
set(CMAKE_CXX_STANDARD_REQUIRED ON)
66
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
77

8-
# Windows: Use dynamic runtime library (/MD) for consistency with dependencies
8+
# Windows: Use dynamic runtime library (/MD) for consistency across all targets
9+
# Must be set BEFORE FetchContent to apply to dependencies
910
if(MSVC)
10-
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
11+
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL" CACHE STRING "" FORCE)
12+
# Also set for static libraries (FTXUI builds as static)
13+
set(CMAKE_POLICY_DEFAULT_CMP0091 NEW)
1114
endif()
1215

1316
# Find OpenSSL for HTTPS support

0 commit comments

Comments
 (0)