diff --git a/Package.swift b/Package.swift index 06d9ed4..15192d3 100644 --- a/Package.swift +++ b/Package.swift @@ -2,6 +2,15 @@ import PackageDescription +let applePlatforms: [Platform] = [ + .iOS, + .macOS, + .tvOS, + .watchOS, + .macCatalyst, + .custom("visionos") +] + let package = Package( name: "CryptoSwift", platforms: [ @@ -14,7 +23,15 @@ let package = Package( ) ], targets: [ - .target(name: "CryptoSwift", resources: [.copy("PrivacyInfo.xcprivacy")]), + // Keep the privacy manifest out of non-Apple builds so SwiftPM doesn't pull in + // Foundation just to synthesize a resource bundle accessor. + .target(name: "CryptoSwiftResources", resources: [.copy("PrivacyInfo.xcprivacy")]), + .target( + name: "CryptoSwift", + dependencies: [ + .target(name: "CryptoSwiftResources", condition: .when(platforms: applePlatforms)) + ] + ), .testTarget(name: "CryptoSwiftTests", dependencies: ["CryptoSwift"]) ], swiftLanguageVersions: [.v5] diff --git a/Sources/CryptoSwiftResources/Empty.swift b/Sources/CryptoSwiftResources/Empty.swift new file mode 100644 index 0000000..69f0aba --- /dev/null +++ b/Sources/CryptoSwiftResources/Empty.swift @@ -0,0 +1,16 @@ +// +// CryptoSwift +// +// Copyright (C) 2014-2025 Marcin Krzyżanowski +// This software is provided 'as-is', without any express or implied warranty. +// +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: +// +// - The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation is required. +// - Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +// - This notice may not be removed or altered from any source or binary distribution. +// + +// Intentionally empty. SwiftPM requires at least one source file for a Swift target. diff --git a/Sources/CryptoSwift/PrivacyInfo.xcprivacy b/Sources/CryptoSwiftResources/PrivacyInfo.xcprivacy similarity index 100% rename from Sources/CryptoSwift/PrivacyInfo.xcprivacy rename to Sources/CryptoSwiftResources/PrivacyInfo.xcprivacy