Skip to content

Commit 4a95611

Browse files
committed
dispatch: install the correct modulemap when building 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!
1 parent 2725ced commit 4a95611

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dispatch/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
33
set(DISPATCH_MODULE_MAP ${PROJECT_SOURCE_DIR}/dispatch/darwin/module.modulemap)
44
else()
5-
set(DISPATCH_MODULE_MAP ${PROJECT_SOURCE_DIR}/dispatch/generic/module.modulemap)
5+
set(DISPATCH_MODULE_MAP ${PROJECT_SOURCE_DIR}/dispatch/generic$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>/module.modulemap)
66
endif()
77
configure_file(dispatch-vfs.yaml.in
88
${CMAKE_BINARY_DIR}/dispatch-vfs-overlay.yaml

0 commit comments

Comments
 (0)