Skip to content

Commit f152471

Browse files
authored
Merge pull request swiftlang#544 from drexin/wip-static-modulemap
Add modulemap for static compilation
2 parents feb4421 + b27f6f3 commit f152471

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

dispatch/CMakeLists.txt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,17 @@ install(FILES
1616
DESTINATION
1717
"${INSTALL_DISPATCH_HEADERS_DIR}")
1818
if(ENABLE_SWIFT)
19-
get_filename_component(MODULE_MAP module.modulemap REALPATH)
19+
set(base_dir "${CMAKE_CURRENT_SOURCE_DIR}")
20+
if(NOT BUILD_SHARED_LIBS)
21+
set(base_dir "${CMAKE_CURRENT_SOURCE_DIR}/generic_static")
22+
endif()
23+
24+
get_filename_component(
25+
MODULE_MAP
26+
module.modulemap
27+
REALPATH
28+
BASE_DIR "${base_dir}")
29+
2030
install(FILES
2131
${MODULE_MAP}
2232
DESTINATION
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module Dispatch {
2+
requires blocks
3+
export *
4+
link "dispatch"
5+
link "BlocksRuntime"
6+
link "DispatchStubs"
7+
}
8+
9+
module DispatchIntrospection [system] [extern_c] {
10+
header "introspection.h"
11+
export *
12+
}
13+
14+
module CDispatch [system] [extern_c] {
15+
umbrella header "dispatch.h"
16+
export *
17+
requires blocks
18+
link "dispatch"
19+
}

0 commit comments

Comments
 (0)