mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-24 04:07:47 +00:00
Avoid build errors by using ad-hoc Swift modules that import the right sqlite3 header depending on the platform (MacOSX, iPhoneOS, iPhoneSimulator).
This commit is contained in:
1 parent
9733fb22fd
commit
c6f96906ca
19 files changed
+165
-21
No files matched your search
@@ -430,8 +430,6 @@
|
||||
565B0FEE1BBC7D980098DE03 /* RowConvertibleTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RowConvertibleTests.swift; sourceTree = "<group>"; };
|
||||
565D5D701BBC694D00DC9BD4 /* Row+FoundationTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Row+FoundationTests.swift"; sourceTree = "<group>"; };
|
||||
565D5D731BBC70AE00DC9BD4 /* StatementArguments+FoundationTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "StatementArguments+FoundationTests.swift"; sourceTree = "<group>"; };
|
||||
567D10631C9A911C00ACC500 /* module.modulemap */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.module-map"; path = module.modulemap; sourceTree = "<group>"; };
|
||||
567D10651C9A911C00ACC500 /* module.modulemap */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.module-map"; path = module.modulemap; sourceTree = "<group>"; };
|
||||
5683C2681B4D445E00296494 /* libsqlite3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsqlite3.dylib; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk/usr/lib/libsqlite3.dylib; sourceTree = DEVELOPER_DIR; };
|
||||
569530FB1C9067CC00CF1A2B /* DatabaseQueueCrashTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DatabaseQueueCrashTests.swift; sourceTree = "<group>"; };
|
||||
569530FC1C9067CC00CF1A2B /* DatabaseValueConvertibleCrashTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DatabaseValueConvertibleCrashTests.swift; sourceTree = "<group>"; };
|
||||
@@ -502,6 +500,7 @@
|
||||
56BB862D1BA98933001F9168 /* GRDBPerformanceTests-Bridging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "GRDBPerformanceTests-Bridging.h"; sourceTree = "<group>"; };
|
||||
56BB862E1BA98AA9001F9168 /* libsqlite3.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.tbd; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/usr/lib/libsqlite3.tbd; sourceTree = DEVELOPER_DIR; };
|
||||
56BB86301BA98AB0001F9168 /* libsqlite3.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.tbd; path = usr/lib/libsqlite3.tbd; sourceTree = SDKROOT; };
|
||||
56C48E731C9A9923005DF1D9 /* module.modulemap */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.module-map"; path = module.modulemap; sourceTree = "<group>"; };
|
||||
56CA21B91BB3FCF7009A04C5 /* NSDataTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NSDataTests.swift; sourceTree = "<group>"; };
|
||||
56CA21FE1BB414FE009A04C5 /* SQLite.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SQLite.xcodeproj; path = SQLite.swift/SQLite.xcodeproj; sourceTree = "<group>"; };
|
||||
56CA22211BB41565009A04C5 /* PerformanceTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PerformanceTests.swift; sourceTree = "<group>"; };
|
||||
@@ -739,7 +738,6 @@
|
||||
567D10621C9A911C00ACC500 /* GRDBiOS */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
567D10631C9A911C00ACC500 /* module.modulemap */,
|
||||
5683C2681B4D445E00296494 /* libsqlite3.dylib */,
|
||||
);
|
||||
path = GRDBiOS;
|
||||
@@ -748,7 +746,6 @@
|
||||
567D10641C9A911C00ACC500 /* GRDBOSX */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
567D10651C9A911C00ACC500 /* module.modulemap */,
|
||||
DC37744219C8DC91004FCF85 /* libsqlite3.dylib */,
|
||||
);
|
||||
path = GRDBOSX;
|
||||
@@ -1124,6 +1121,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
56B8F49A1B4E2F3600C24296 /* GRDB.xcconfig */,
|
||||
56C48E731C9A9923005DF1D9 /* module.modulemap */,
|
||||
567D10621C9A911C00ACC500 /* GRDBiOS */,
|
||||
567D10641C9A911C00ACC500 /* GRDBOSX */,
|
||||
DC3773F819C8CBB3004FCF85 /* GRDB.h */,
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
import Foundation
|
||||
|
||||
#if os(OSX)
|
||||
import SQLiteMacOSX
|
||||
#elseif os(iOS)
|
||||
#if (arch(i386) || arch(x86_64))
|
||||
import SQLiteiPhoneSimulator
|
||||
#else
|
||||
import SQLiteiPhoneOS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/// Configuration for a DatabaseQueue or DatabasePool.
|
||||
public struct Configuration {
|
||||
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
import Foundation
|
||||
|
||||
#if os(OSX)
|
||||
import SQLiteMacOSX
|
||||
#elseif os(iOS)
|
||||
#if (arch(i386) || arch(x86_64))
|
||||
import SQLiteiPhoneSimulator
|
||||
#else
|
||||
import SQLiteiPhoneOS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/// A raw SQLite connection, suitable for the SQLite C API.
|
||||
public typealias SQLiteConnection = COpaquePointer
|
||||
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
#if os(OSX)
|
||||
import SQLiteMacOSX
|
||||
#elseif os(iOS)
|
||||
#if (arch(i386) || arch(x86_64))
|
||||
import SQLiteiPhoneSimulator
|
||||
#else
|
||||
import SQLiteiPhoneOS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/// DatabaseError wraps an SQLite error.
|
||||
public struct DatabaseError : ErrorType {
|
||||
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
#if os(OSX)
|
||||
import SQLiteMacOSX
|
||||
#elseif os(iOS)
|
||||
#if (arch(i386) || arch(x86_64))
|
||||
import SQLiteiPhoneSimulator
|
||||
#else
|
||||
import SQLiteiPhoneOS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/// A DatabasePool grants concurrent accesses to an SQLite database.
|
||||
public final class DatabasePool {
|
||||
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
import Foundation
|
||||
|
||||
#if os(OSX)
|
||||
import SQLiteMacOSX
|
||||
#elseif os(iOS)
|
||||
#if (arch(i386) || arch(x86_64))
|
||||
import SQLiteiPhoneSimulator
|
||||
#else
|
||||
import SQLiteiPhoneOS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// MARK: - DatabaseValue
|
||||
|
||||
/// DatabaseValue is the intermediate type between SQLite and your values.
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
import Foundation
|
||||
|
||||
#if os(OSX)
|
||||
import SQLiteMacOSX
|
||||
#elseif os(iOS)
|
||||
#if (arch(i386) || arch(x86_64))
|
||||
import SQLiteiPhoneSimulator
|
||||
#else
|
||||
import SQLiteiPhoneOS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/// A database row.
|
||||
public final class Row {
|
||||
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
import Foundation
|
||||
|
||||
#if os(OSX)
|
||||
import SQLiteMacOSX
|
||||
#elseif os(iOS)
|
||||
#if (arch(i386) || arch(x86_64))
|
||||
import SQLiteiPhoneSimulator
|
||||
#else
|
||||
import SQLiteiPhoneOS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/// A raw SQLite statement, suitable for the SQLite C API.
|
||||
public typealias SQLiteStatement = COpaquePointer
|
||||
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
#if os(OSX)
|
||||
import SQLiteMacOSX
|
||||
#elseif os(iOS)
|
||||
#if (arch(i386) || arch(x86_64))
|
||||
import SQLiteiPhoneSimulator
|
||||
#else
|
||||
import SQLiteiPhoneOS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/// When a type adopts both DatabaseValueConvertible and
|
||||
/// StatementColumnConvertible, it is granted with faster access to the SQLite
|
||||
/// database values.
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
#if os(OSX)
|
||||
import SQLiteMacOSX
|
||||
#elseif os(iOS)
|
||||
#if (arch(i386) || arch(x86_64))
|
||||
import SQLiteiPhoneSimulator
|
||||
#else
|
||||
import SQLiteiPhoneOS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/// Bool adopts DatabaseValueConvertible and StatementColumnConvertible.
|
||||
extension Bool: DatabaseValueConvertible, StatementColumnConvertible {
|
||||
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
import Foundation
|
||||
|
||||
#if os(OSX)
|
||||
import SQLiteMacOSX
|
||||
#elseif os(iOS)
|
||||
#if (arch(i386) || arch(x86_64))
|
||||
import SQLiteiPhoneSimulator
|
||||
#else
|
||||
import SQLiteiPhoneOS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
// MARK: - Public
|
||||
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
#if os(OSX)
|
||||
import SQLiteMacOSX
|
||||
#elseif os(iOS)
|
||||
#if (arch(i386) || arch(x86_64))
|
||||
import SQLiteiPhoneSimulator
|
||||
#else
|
||||
import SQLiteiPhoneOS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/// An internal struct that defines a migration.
|
||||
struct Migration {
|
||||
let identifier: String
|
||||
|
||||
@@ -1 +1 @@
|
||||
MODULEMAP_FILE = $(SRCROOT)/Support/$(TARGET_NAME)/module.modulemap
|
||||
MODULEMAP_FILE = $(SRCROOT)/Support/module.modulemap
|
||||
@@ -1,8 +0,0 @@
|
||||
framework module GRDB {
|
||||
umbrella header "GRDB.h"
|
||||
|
||||
header "/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/sqlite3.h"
|
||||
|
||||
export *
|
||||
module * { export * }
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
framework module GRDB {
|
||||
umbrella header "GRDB.h"
|
||||
|
||||
header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/sqlite3.h"
|
||||
|
||||
export *
|
||||
module * { export * }
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
framework module GRDB {
|
||||
umbrella header "GRDB.h"
|
||||
|
||||
export *
|
||||
module * { export * }
|
||||
}
|
||||
|
||||
module SQLiteMacOSX {
|
||||
header "/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/sqlite3.h"
|
||||
export *
|
||||
}
|
||||
|
||||
module SQLiteiPhoneOS {
|
||||
header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/sqlite3.h"
|
||||
export *
|
||||
}
|
||||
|
||||
module SQLiteiPhoneSimulator {
|
||||
header "/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include/sqlite3.h"
|
||||
export *
|
||||
}
|
||||
@@ -1,4 +1,15 @@
|
||||
import XCTest
|
||||
|
||||
#if os(OSX)
|
||||
import SQLiteMacOSX
|
||||
#elseif os(iOS)
|
||||
#if (arch(i386) || arch(x86_64))
|
||||
import SQLiteiPhoneSimulator
|
||||
#else
|
||||
import SQLiteiPhoneOS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@testable import GRDB
|
||||
|
||||
class NSDataMemoryTests: GRDBTestCase {
|
||||
|
||||
@@ -1,6 +1,16 @@
|
||||
import XCTest
|
||||
import GRDB
|
||||
|
||||
#if os(OSX)
|
||||
import SQLiteMacOSX
|
||||
#elseif os(iOS)
|
||||
#if (arch(i386) || arch(x86_64))
|
||||
import SQLiteiPhoneSimulator
|
||||
#else
|
||||
import SQLiteiPhoneOS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// A type that adopts DatabaseValueConvertible but does not adopt StatementColumnConvertible
|
||||
private struct WrappedInt: DatabaseValueConvertible {
|
||||
let int: Int
|
||||
|
||||
+10
@@ -1,6 +1,16 @@
|
||||
import XCTest
|
||||
import GRDB
|
||||
|
||||
#if os(OSX)
|
||||
import SQLiteMacOSX
|
||||
#elseif os(iOS)
|
||||
#if (arch(i386) || arch(x86_64))
|
||||
import SQLiteiPhoneSimulator
|
||||
#else
|
||||
import SQLiteiPhoneOS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// A type that adopts DatabaseValueConvertible and StatementColumnConvertible
|
||||
private struct FastWrappedInt: DatabaseValueConvertible, StatementColumnConvertible {
|
||||
let int: Int
|
||||
|
||||
Reference in new issue
Block a user