Skip to content

Commit 7b1423e

Browse files
committed
build: always build libdispatch in shared mode
As per the discussion with @rokhinip, @mikeash, and @compnerd, always build libdispatch 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. Until we have a resolution on BlocksRuntime, build the library both ways. Note that in order to use a static copy of BlocksRuntime, `-static-libclosure` must be used at *compile* time.
1 parent 631053d commit 7b1423e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)