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)
93
93
if (1 )
94
94
get_target_property (runtime ${TARGET} MSVC_RUNTIME_LIBRARY )
95
95
96
+ set (runtime_str "" )
97
+
96
98
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>" )
106
105
else ()
107
106
# Per CMake documentation: if MSVC_RUNTIME_LIBRARY is not set, then
108
107
# CMake uses the default value MultiThreaded$<$<CONFIG:Debug>:Debug>DLL
You can’t perform that action at this time.
0 commit comments