Skip to content

Commit 2c9f19e

Browse files
committed
xcode / autoconf plumbing to select module.modulemap file
1 parent adc5775 commit 2c9f19e

File tree

9 files changed

+32
-5
lines changed

9 files changed

+32
-5
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,5 @@ config
2929
configure
3030
libtool
3131
.dirstamp
32+
/dispatch/module.modulemap
33+
/private/module.modulemap

configure.ac

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,20 @@ AS_IF([test "x$have_mach" = "xtrue"], [
432432
])
433433
AM_CONDITIONAL(HAVE_DARWIN_LD, [test "x$dispatch_cv_ld_darwin" == "xyes"])
434434

435+
#
436+
# symlink platform-specific module.modulemap files
437+
#
438+
AS_CASE([$target_os],
439+
[darwin*], [ dispatch_module_map_os=darwin ],
440+
[ dispatch_module_map_os=generic ]
441+
)
442+
AC_CONFIG_COMMANDS([modulemaps], [
443+
ln -fs $dispatch_module_map_os/module.modulemap $ac_top_srcdir/dispatch/module.modulemap
444+
ln -fs $dispatch_module_map_os/module.modulemap $ac_top_srcdir/private/module.modulemap
445+
],
446+
[dispatch_module_map_os="$dispatch_module_map_os"]
447+
)
448+
435449
#
436450
# Temporary: some versions of clang do not mark __builtin_trap() as
437451
# __attribute__((__noreturn__)). Detect and add if required.
@@ -449,6 +463,6 @@ AC_CONFIG_FILES([Makefile dispatch/Makefile man/Makefile os/Makefile private/Mak
449463
#
450464
# Generate testsuite links
451465
#
452-
AC_CONFIG_LINKS([tests/dispatch:$top_srcdir/private tests/leaks-wrapper:tests/leaks-wrapper.sh])
466+
AC_CONFIG_LINKS([tests/dispatch:$ac_top_srcdir/private tests/leaks-wrapper:tests/leaks-wrapper.sh])
453467

454468
AC_OUTPUT

dispatch/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ dispatch_HEADERS= \
2424
time.h
2525

2626
if HAVE_SWIFT
27-
dispatch_HEADERS+=module.map
27+
dispatch_HEADERS+=module.modulemap
2828
endif
File renamed without changes.
File renamed without changes.

libdispatch.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -662,8 +662,8 @@
662662
C01866BD1C5973210040FC07 /* libdispatch.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libdispatch.a; sourceTree = BUILT_PRODUCTS_DIR; };
663663
C01866BE1C59735B0040FC07 /* libdispatch-mp-static.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "libdispatch-mp-static.xcconfig"; sourceTree = "<group>"; };
664664
C01866BF1C5976C90040FC07 /* run-on-install.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "run-on-install.sh"; sourceTree = "<group>"; };
665-
C901445E1C73A7FE002638FC /* module.modulemap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; path = module.modulemap; sourceTree = "<group>"; };
666-
C90144641C73A845002638FC /* module.modulemap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; path = module.modulemap; sourceTree = "<group>"; };
665+
C901445E1C73A7FE002638FC /* module.modulemap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; name = module.modulemap; path = darwin/module.modulemap; sourceTree = "<group>"; };
666+
C90144641C73A845002638FC /* module.modulemap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; name = module.modulemap; path = darwin/module.modulemap; sourceTree = "<group>"; };
667667
C913AC0E143BD34800B78976 /* data_private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = data_private.h; sourceTree = "<group>"; tabWidth = 8; };
668668
C927F35F10FD7F1000C5AB8B /* ddt.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ddt.xcodeproj; path = tools/ddt/ddt.xcodeproj; sourceTree = "<group>"; };
669669
C96CE17A1CEB851600F4B8E6 /* dispatch_objc.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = dispatch_objc.m; sourceTree = "<group>"; };
File renamed without changes.

private/generic/module.modulemap

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module DispatchPrivate [system] [extern_c] {
2+
umbrella header "private.h"
3+
exclude header "mach_private.h"
4+
module * { export * }
5+
export *
6+
}
7+
8+
module DispatchIntrospectionPrivate [system] [extern_c] {
9+
header "introspection_private.h"
10+
export *
11+
}

src/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ SWIFT_GEN_FILES= \
164164
$(SWIFT_OBJ_FILES:%=%.~partial.swiftdoc) \
165165
$(SWIFT_OBJ_FILES:%=%.~partial.swiftdeps)
166166

167-
SWIFTC_FLAGS = -Xcc -fmodule-map-file=$(abs_top_srcdir)/dispatch/module.map -I$(abs_top_srcdir) -Xcc -fblocks
167+
SWIFTC_FLAGS = -Xcc -fmodule-map-file=$(abs_top_srcdir)/dispatch/module.modulemap -I$(abs_top_srcdir) -Xcc -fblocks
168168
if DISPATCH_ENABLE_OPTIMIZATION
169169
SWIFTC_FLAGS+=-O
170170
endif

0 commit comments

Comments
 (0)