Skip to content

Android: switch to the new swift-toolchain-sqlite package instead of requiring an external dependency #8148

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
Dec 3, 2024
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
7 changes: 5 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ let includeDynamicLibrary: Bool = false
let systemSQLitePkgConfig: String? = nil
#else
let includeDynamicLibrary: Bool = true
let systemSQLitePkgConfig: String? = "sqlite3"
var systemSQLitePkgConfig: String? = "sqlite3"
if ProcessInfo.processInfo.environment["SWIFTCI_INSTALL_RPATH_OS"] == "android" {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only set by the official build-script, so it will only work in that scenario, which is fine as most builds of this repo happen that way.

Eventually, systemLibrary dependencies should be conditional on the platform, but that is not available yet.

systemSQLitePkgConfig = nil
}
#endif

/** An array of products which have two versions listed: one dynamically linked, the other with the
Expand Down Expand Up @@ -199,7 +202,7 @@ let package = Package(
dependencies: [
"_AsyncFileSystem",
.target(name: "SPMSQLite3", condition: .when(platforms: [.macOS, .iOS, .tvOS, .watchOS, .visionOS, .macCatalyst, .linux])),
.product(name: "SwiftToolchainCSQLite", package: "swift-toolchain-sqlite", condition: .when(platforms: [.windows])),
.product(name: "SwiftToolchainCSQLite", package: "swift-toolchain-sqlite", condition: .when(platforms: [.windows, .android])),
.product(name: "DequeModule", package: "swift-collections"),
.product(name: "OrderedCollections", package: "swift-collections"),
.product(name: "SwiftToolsSupport-auto", package: "swift-tools-support-core"),
Expand Down
2 changes: 1 addition & 1 deletion Sources/Basics/SQLite.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import Foundation

#if SWIFT_PACKAGE && os(Windows)
#if SWIFT_PACKAGE && (os(Windows) || os(Android))
#if USE_IMPL_ONLY_IMPORTS
@_implementationOnly import SwiftToolchainCSQLite
#else
Expand Down