Skip to content

Add modulemap for static compilation #544

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion dispatch/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,17 @@ install(FILES
DESTINATION
"${INSTALL_DISPATCH_HEADERS_DIR}")
if(ENABLE_SWIFT)
get_filename_component(MODULE_MAP module.modulemap REALPATH)
set(base_dir "${CMAKE_CURRENT_SOURCE_DIR}")
if(NOT BUILD_SHARED_LIBS)
set(base_dir "${CMAKE_CURRENT_SOURCE_DIR}/generic_static")
endif()

get_filename_component(
MODULE_MAP
module.modulemap
REALPATH
BASE_DIR "${base_dir}")

install(FILES
${MODULE_MAP}
DESTINATION
Expand Down
19 changes: 19 additions & 0 deletions dispatch/generic_static/module.modulemap
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module Dispatch {
requires blocks
export *
link "dispatch"
link "BlocksRuntime"
link "DispatchStubs"
}

module DispatchIntrospection [system] [extern_c] {
header "introspection.h"
export *
}

module CDispatch [system] [extern_c] {
umbrella header "dispatch.h"
export *
requires blocks
link "dispatch"
}