Skip to content

Commit 10d9f92

Browse files
authored
Merge pull request #793 from compnerd/static
There is a subtle difference between libdispatch built dynamically and statically: DispatchStubs. We erroneously emit ObjC runtime calls into the build and the stubs provides a shim to provide a definition on non-ObjC runtime enabled targets. When built dynamically, this is internalised and distributed as part of dispatch.dll/libdispatch.so, however when built statically, the consumer is responsible for linking against DispatchStubs. The modulemap reflects this and we need to ensure that we correctly provide that modulemap. Thanks to @MaxDesiatov for the help with debugging and testing a fix for this! Related: rdar://23335318
2 parents 2725ced + a0715dc commit 10d9f92

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

dispatch/CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11

22
if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
33
set(DISPATCH_MODULE_MAP ${PROJECT_SOURCE_DIR}/dispatch/darwin/module.modulemap)
4-
else()
4+
elseif(BUILD_SHARED_LIBS)
55
set(DISPATCH_MODULE_MAP ${PROJECT_SOURCE_DIR}/dispatch/generic/module.modulemap)
6+
else()
7+
set(DISPATCH_MODULE_MAP ${PROJECT_SOURCE_DIR}/dispatch/generic_static/module.modulemap)
68
endif()
79
configure_file(dispatch-vfs.yaml.in
810
${CMAKE_BINARY_DIR}/dispatch-vfs-overlay.yaml

0 commit comments

Comments
 (0)