From e27392d23694117d3685f4367c00278c7e197ff2 Mon Sep 17 00:00:00 2001 From: Rick Newton-Rogers Date: Tue, 10 Dec 2024 10:43:47 +0000 Subject: [PATCH] Enable MemberImportVisibility check on all targets --- Package.swift | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/Package.swift b/Package.swift index c993da71..8f446da3 100644 --- a/Package.swift +++ b/Package.swift @@ -37,7 +37,7 @@ if development { dependencies = [ "CCryptoBoringSSL", "CCryptoBoringSSLShims", - "CryptoBoringWrapper" + "CryptoBoringWrapper", ] } else { let platforms: [Platform] = [ @@ -53,7 +53,7 @@ if development { dependencies = [ .target(name: "CCryptoBoringSSL", condition: .when(platforms: platforms)), .target(name: "CCryptoBoringSSLShims", condition: .when(platforms: platforms)), - .target(name: "CryptoBoringWrapper", condition: .when(platforms: platforms)) + .target(name: "CryptoBoringWrapper", condition: .when(platforms: platforms)), ] } @@ -100,7 +100,7 @@ let package = Package( */ "crypto/bio/connect.c", "crypto/bio/socket_helper.c", - "crypto/bio/socket.c" + "crypto/bio/socket.c", ], resources: privacyManifestResource, cSettings: [ @@ -112,7 +112,10 @@ let package = Package( /* * These defines are required on Wasm/WASI, to disable use of pthread. */ - .define("OPENSSL_NO_THREADS_CORRUPT_MEMORY_AND_LEAK_SECRETS_IF_THREADED", .when(platforms: [Platform.wasi])), + .define( + "OPENSSL_NO_THREADS_CORRUPT_MEMORY_AND_LEAK_SECRETS_IF_THREADED", + .when(platforms: [Platform.wasi]) + ), .define("OPENSSL_NO_ASM", .when(platforms: [Platform.wasi])), ] ), @@ -144,10 +147,10 @@ let package = Package( "CCryptoBoringSSLShims", "CryptoBoringWrapper", "Crypto", - .product(name: "SwiftASN1", package: "swift-asn1") + .product(name: "SwiftASN1", package: "swift-asn1"), ], exclude: privacyManifestExclude + [ - "CMakeLists.txt", + "CMakeLists.txt" ], resources: privacyManifestResource, swiftSettings: swiftSettings @@ -156,10 +159,10 @@ let package = Package( name: "CryptoBoringWrapper", dependencies: [ "CCryptoBoringSSL", - "CCryptoBoringSSLShims" + "CCryptoBoringSSLShims", ], exclude: privacyManifestExclude + [ - "CMakeLists.txt", + "CMakeLists.txt" ], resources: privacyManifestResource ), @@ -168,7 +171,7 @@ let package = Package( name: "CryptoTests", dependencies: ["Crypto"], resources: [ - .copy("HPKE/hpke-test-vectors.json"), + .copy("HPKE/hpke-test-vectors.json") ], swiftSettings: swiftSettings ), @@ -188,3 +191,11 @@ let package = Package( ], cxxLanguageStandard: .cxx14 ) + +for target in package.targets { + if target.type != .plugin { + var settings = target.swiftSettings ?? [] + settings.append(.enableUpcomingFeature("MemberImportVisibility")) + target.swiftSettings = settings + } +}