From c9d565637dd949acaa784e5960eb569ce98c6edf Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Fri, 10 May 2019 08:25:33 -0700 Subject: [PATCH] build: ensure that we link against the correct library Ensure that we link against the correct VC runtime libraries. Additionally, enable the macros to indicate that we are linking against the VC runtimes dynamically to get proper DLL storage. This fixes memory issues and file descriptor table synchrony. --- src/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 21121bf4f..e24331096 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -124,6 +124,9 @@ if(ENABLE_SWIFT) CFLAGS -fblocks -fmodule-map-file=${PROJECT_SOURCE_DIR}/dispatch/module.modulemap + $<$:-D_MT> + # TODO(compnerd) handle /MT builds + $<$:-D_DLL> DEPENDS module-maps DispatchStubs @@ -134,6 +137,8 @@ if(ENABLE_SWIFT) -lBlocksRuntime -L $ -ldispatch + $<$,$>:-lmsvcrtd> + $<$,$>>:-lmsvcrt> MODULE_NAME Dispatch MODULE_LINK_NAME