Skip to content

Commit 59349f9

Browse files
committed
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.
1 parent 6864757 commit 59349f9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/BlocksRuntime/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
add_library(BlocksRuntime
2+
add_library(BlocksRuntime SHARED
33
data.c
44
runtime.c)
55
if(WIN32)

src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
add_library(dispatch
2+
add_library(dispatch SHARED
33
allocator.c
44
apply.c
55
benchmark.c

0 commit comments

Comments
 (0)