Skip to content

Commit d5f862b

Browse files
committed
---
yaml --- r: 319285 b: refs/heads/master-rebranch c: 9e289b4 h: refs/heads/master i: 319283: 5214fb7
1 parent 83fd259 commit d5f862b

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1457,4 +1457,4 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2019-08-02-a: ddd2b2976aa9bfde5f20fe37f6bd2
14571457
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2019-08-03-a: 171cc166f2abeb5ca2a4003700a8a78a108bd300
14581458
refs/heads/benlangmuir-patch-1: baaebaf39d52f3bf36710d4fe40cf212e996b212
14591459
refs/heads/i-do-redeclare: 8c4e6d5de5c1e3f0a2cedccf319df713ea22c48e
1460-
refs/heads/master-rebranch: 5fd09649048caa793a24951c7f6827362baae164
1460+
refs/heads/master-rebranch: 9e289b4b1a8cf5669fdf3c0e81e5ba438850f09e

branches/master-rebranch/cmake/modules/AddSwift.cmake

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,15 +230,13 @@ function(_add_variant_c_compile_flags)
230230

231231
if("${CFLAGS_SDK}" STREQUAL "WINDOWS")
232232
# 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.
234234
if(NOT "${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
235235
list(APPEND result -Xclang;--dependent-lib=oldnames)
236236
# TODO(compnerd) handle /MT, /MTd
237237
if("${CFLAGS_BUILD_TYPE}" STREQUAL "Debug")
238-
list(APPEND result "-D_MDd")
239238
list(APPEND result -Xclang;--dependent-lib=msvcrtd)
240239
else()
241-
list(APPEND result "-D_MD")
242240
list(APPEND result -Xclang;--dependent-lib=msvcrt)
243241
endif()
244242
endif()
@@ -260,6 +258,7 @@ function(_add_variant_c_compile_flags)
260258
if("${CFLAGS_ARCH}" MATCHES arm)
261259
list(APPEND result "-D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE")
262260
endif()
261+
list(APPEND result "-D_MT")
263262
# TODO(compnerd) handle /MT
264263
list(APPEND result "-D_DLL")
265264
# NOTE: We assume that we are using VS 2015 U2+
@@ -401,6 +400,12 @@ function(_add_variant_swift_compile_flags
401400
list(APPEND result "-D" "SWIFT_ENABLE_RUNTIME_FUNCTION_COUNTERS")
402401
endif()
403402

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+
404409
set("${result_var_name}" "${result}" PARENT_SCOPE)
405410
endfunction()
406411

0 commit comments

Comments
 (0)