@@ -230,15 +230,13 @@ function(_add_variant_c_compile_flags)
230
230
231
231
if ("${CFLAGS_SDK} " STREQUAL "WINDOWS" )
232
232
# MSVC doesn't support -Xclang. We don't need to manually specify
233
- # -D_MD or D_MDd either, as CMake does this automatically .
233
+ # the dependent libraries as `cl` does so .
234
234
if (NOT "${CMAKE_C_COMPILER_ID} " STREQUAL "MSVC" )
235
235
list (APPEND result -Xclang;--dependent-lib=oldnames )
236
236
# TODO(compnerd) handle /MT, /MTd
237
237
if ("${CFLAGS_BUILD_TYPE} " STREQUAL "Debug" )
238
- list (APPEND result "-D_MDd" )
239
238
list (APPEND result -Xclang;--dependent-lib=msvcrtd )
240
239
else ()
241
- list (APPEND result "-D_MD" )
242
240
list (APPEND result -Xclang;--dependent-lib=msvcrt )
243
241
endif ()
244
242
endif ()
@@ -260,6 +258,7 @@ function(_add_variant_c_compile_flags)
260
258
if ("${CFLAGS_ARCH} " MATCHES arm )
261
259
list (APPEND result "-D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE" )
262
260
endif ()
261
+ list (APPEND result "-D_MT" )
263
262
# TODO(compnerd) handle /MT
264
263
list (APPEND result "-D_DLL" )
265
264
# NOTE: We assume that we are using VS 2015 U2+
@@ -401,6 +400,12 @@ function(_add_variant_swift_compile_flags
401
400
list (APPEND result "-D" "SWIFT_ENABLE_RUNTIME_FUNCTION_COUNTERS" )
402
401
endif ()
403
402
403
+ if (sdk STREQUAL WINDOWS )
404
+ list (APPEND result "-Xcc" "-D_MT" )
405
+ # TODO(compnerd) handle /MT /MTd
406
+ list (APPEND result "-Xcc" "-D_DLL" )
407
+ endif ()
408
+
404
409
set ("${result_var_name} " "${result} " PARENT_SCOPE )
405
410
endfunction ()
406
411
0 commit comments