Skip to content

Commit 7784917

Browse files
Merge pull request #480 from compnerd/one-is-better-than-many
build: ensure that we link against the correct library
2 parents b073d89 + c9d5656 commit 7784917

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ if(ENABLE_SWIFT)
124124
CFLAGS
125125
-fblocks
126126
-fmodule-map-file=${PROJECT_SOURCE_DIR}/dispatch/module.modulemap
127+
$<$<PLATFORM_ID:Windows>:-D_MT>
128+
# TODO(compnerd) handle /MT builds
129+
$<$<PLATFORM_ID:Windows>:-D_DLL>
127130
DEPENDS
128131
module-maps
129132
DispatchStubs
@@ -134,6 +137,8 @@ if(ENABLE_SWIFT)
134137
-lBlocksRuntime
135138
-L $<TARGET_LINKER_FILE_DIR:dispatch>
136139
-ldispatch
140+
$<$<AND:$<PLATFORM_ID:Windows>,$<CONFIG:Debug>>:-lmsvcrtd>
141+
$<$<AND:$<PLATFORM_ID:Windows>,$<NOT:$<CONFIG:Debug>>>:-lmsvcrt>
137142
MODULE_NAME
138143
Dispatch
139144
MODULE_LINK_NAME

0 commit comments

Comments
 (0)