File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -93,16 +93,15 @@ function(bsoncxx_add_library TARGET OUTPUT_NAME LINK_TYPE)
9393 if (1)
9494 get_target_property (runtime ${TARGET} MSVC_RUNTIME_LIBRARY)
9595
96+ set (runtime_str "" )
97+
9698 if (runtime)
97- if (runtime STREQUAL "MultiThreaded" )
98- set (runtime_str "mt" )
99- elseif (runtime STREQUAL "MultiThreadedDebug" )
100- set (runtime_str "mtd" )
101- elseif (runtime STREQUAL "MultiThreadedDLL" )
102- set (runtime_str "md" )
103- elseif (runtime STREQUAL "MultiThreadedDebugDLL" )
104- set (runtime_str "mdd" )
105- endif ()
99+ # MSVC_RUNTIME_LIBRARY may contain generator expressions.
100+ # Therefore the comparison must be evaluated during the build generation step.
101+ string (APPEND runtime_str "$<$<STREQUAL:${runtime} ,MultiThreaded>:mt>" )
102+ string (APPEND runtime_str "$<$<STREQUAL:${runtime} ,MultiThreadedDebug>:mtd>" )
103+ string (APPEND runtime_str "$<$<STREQUAL:${runtime} ,MultiThreadedDLL>:md>" )
104+ string (APPEND runtime_str "$<$<STREQUAL:${runtime} ,MultiThreadedDebugDLL>:mdd>" )
106105 else ()
107106 # Per CMake documentation: if MSVC_RUNTIME_LIBRARY is not set, then
108107 # CMake uses the default value MultiThreaded$<$<CONFIG:Debug>:Debug>DLL
You can’t perform that action at this time.
0 commit comments