Skip to content

Commit 8d2903b

Browse files
committed
CocoaPods fix: Use platform-specific module maps
Xcode 7.3 got more strict about SDK headers. We need to use multiple module maps to accommodate various platforms and we need to scope `requires` to accommodate various architecturers. Signed-off-by: Stephen Celis <stephen@stephencelis.com>
1 parent d027704 commit 8d2903b

File tree

5 files changed

+36
-10
lines changed

5 files changed

+36
-10
lines changed

podstuff/module.modulemap renamed to CocoaPods/ios.modulemap

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,21 @@
11
framework module SQLite {
22
umbrella header "SQLite.h"
33

4-
// Load the SDK header alongside SQLite.swift. Alternate headers:
5-
//
6-
// header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include/sqlite3.h"
7-
// header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/sqlite3.h"
8-
// header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/sqlite3.h"
94
module arm {
105
header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/sqlite3.h"
116
requires arm
127
}
13-
8+
149
module arm64 {
1510
header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/sqlite3.h"
1611
requires arm64
1712
}
18-
13+
1914
module x86 {
2015
header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include/sqlite3.h"
2116
requires x86
2217
}
23-
18+
2419
link "sqlite3"
2520

2621
export *

CocoaPods/osx.modulemap

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
framework module SQLite {
2+
umbrella header "SQLite.h"
3+
4+
header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/sqlite3.h"
5+
6+
link "sqlite3"
7+
8+
export *
9+
module * { export * }
10+
}

CocoaPods/tvos.modulemap

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
framework module SQLite {
2+
umbrella header "SQLite.h"
3+
4+
module arm64 {
5+
header "/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/usr/include/sqlite3.h"
6+
requires arm64
7+
}
8+
9+
module x86 {
10+
header "/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator.sdk/usr/include/sqlite3.h"
11+
requires x86
12+
}
13+
14+
link "sqlite3"
15+
16+
export *
17+
module * { export * }
18+
}

SQLite.swift.podspec

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ Pod::Spec.new do |s|
2424
s.tvos.deployment_target = "9.0"
2525
s.osx.deployment_target = "10.9"
2626

27-
s.module_map = "podstuff/module.modulemap"
27+
s.ios.module_map = "CocoaPods/ios.modulemap"
28+
s.tvos.module_map = "CocoaPods/tvos.modulemap"
29+
s.osx.module_map = "CocoaPods/osx.modulemap"
30+
2831
s.libraries = 'sqlite3'
2932
s.source_files = 'SQLite/**/*.{c,h,m,swift}'
3033
s.private_header_files = 'SQLite/Core/fts3_tokenizer.h'

SQLite.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153
/* Begin PBXFileReference section */
154154
03A65E5A1C6BB0F50062603F /* SQLite.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SQLite.framework; sourceTree = BUILT_PRODUCTS_DIR; };
155155
03A65E631C6BB0F60062603F /* SQLiteTests tvOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "SQLiteTests tvOS.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
156-
03A65E961C6BB3210062603F /* libsqlite3.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.tbd; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.1.sdk/usr/lib/libsqlite3.tbd; sourceTree = DEVELOPER_DIR; };
156+
03A65E961C6BB3210062603F /* libsqlite3.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.tbd; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/usr/lib/libsqlite3.tbd; sourceTree = DEVELOPER_DIR; };
157157
EE247AD31C3F04ED00AE3E12 /* SQLite.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SQLite.framework; sourceTree = BUILT_PRODUCTS_DIR; };
158158
EE247AD61C3F04ED00AE3E12 /* SQLite.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SQLite.h; sourceTree = "<group>"; };
159159
EE247AD81C3F04ED00AE3E12 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };

0 commit comments

Comments
 (0)