Skip to content

Commit

Permalink
Only include PrivacyInfo.xcprivacy on some platforms.
Browse files Browse the repository at this point in the history
AppleStore only requires the informatiion on iOS, watchOS, tvOS, visionOS; so
exclude the resources for Linux and macOS.

As of Swift 5.10 (apple#1560), the generated Linux code when there are resources gets
flagged with issues when using `StrictConcurrency=complete`; so this dodges the
issue.
  • Loading branch information
thomasvl committed Mar 19, 2024
1 parent 8c295ee commit 20982f3
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@

import PackageDescription

// NOTE: Once all supported Swift versions support visionOS, this gate could be
// flipped to only require in on the specific platforms it is needed.
#if !os(Linux) && !os(macOS)
let include_privacy_manifests = true
#else
let include_privacy_manifests = false
#endif


let package = Package(
name: "SwiftProtobuf",
products: [
Expand Down Expand Up @@ -38,14 +47,14 @@ let package = Package(
.target(
name: "SwiftProtobuf",
exclude: ["CMakeLists.txt"],
resources: [.copy("PrivacyInfo.xcprivacy")],
resources: include_privacy_manifests ? [.copy("PrivacyInfo.xcprivacy")] : [],
swiftSettings: .packageSettings
),
.target(
name: "SwiftProtobufPluginLibrary",
dependencies: ["SwiftProtobuf"],
exclude: ["CMakeLists.txt"],
resources: [.copy("PrivacyInfo.xcprivacy")],
resources: include_privacy_manifests ? [.copy("PrivacyInfo.xcprivacy")] : [],
swiftSettings: .packageSettings
),
.target(
Expand Down

0 comments on commit 20982f3

Please sign in to comment.