File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ ENDIF()
67
67
OPTION (WIN_DEBUG_NO_INLINE "Disable inlining for debug builds on Windows" OFF )
68
68
69
69
IF (MSVC )
70
+ OPTION (LINK_STATIC_RUNTIME_LIBRARIES "Link with /MT" OFF )
70
71
# Enable debug info also in Release build,
71
72
# and create PDB to be able to analyze crashes.
72
73
FOREACH (type EXE SHARED MODULE )
@@ -103,8 +104,9 @@ IF(MSVC)
103
104
CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_DEBUG_INIT
104
105
CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELWITHDEBINFO
105
106
CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_DEBUG_INIT )
106
- # Disable this substitution, use default, which is /MD
107
- # STRING(REPLACE "/MD" "/MT" "${flag}" "${${flag}}")
107
+ IF (LINK_STATIC_RUNTIME_LIBRARIES )
108
+ STRING (REPLACE "/MD" "/MT" "${flag} " "${${flag} }" )
109
+ ENDIF ()
108
110
STRING (REPLACE "/Zi" "/Z7" "${flag} " "${${flag} }" )
109
111
IF (NOT WIN_DEBUG_NO_INLINE )
110
112
STRING (REPLACE "/Ob0" "/Ob1" "${flag} " "${${flag} }" )
You can’t perform that action at this time.
0 commit comments