From 59349f98a4ae234f5eaa716044a3d7d659b79900 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Thu, 15 May 2025 21:01:06 -0700 Subject: [PATCH] build: always build libdispatch in shared mode As per the discussion with @rokhinip, @mikeash, and @compnerd, always build libdispatch and libclosure in shared mode. The rationale for this is the following: If someone does a `-static-stdlib` build of Swift code as a plugin which is hosted in a C/C++ environment, you cannot have two dispatch implementations to run this. You need a single one, and because the host environment may be dynamically linked - you need to dynamically link libdispatch (the C portions). This prepares us to be able to build the rest of the dispatch code (swiftDispatch) both statically and dynamically. --- src/BlocksRuntime/CMakeLists.txt | 2 +- src/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/BlocksRuntime/CMakeLists.txt b/src/BlocksRuntime/CMakeLists.txt index 3732b0aec..aa679303b 100644 --- a/src/BlocksRuntime/CMakeLists.txt +++ b/src/BlocksRuntime/CMakeLists.txt @@ -1,5 +1,5 @@ -add_library(BlocksRuntime +add_library(BlocksRuntime SHARED data.c runtime.c) if(WIN32) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b436454e9..b7c444bd8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,5 +1,5 @@ -add_library(dispatch +add_library(dispatch SHARED allocator.c apply.c benchmark.c