Skip to content

Commit

Permalink
Enable MemberImportVisibility check on all targets
Browse files Browse the repository at this point in the history
  • Loading branch information
rnro committed Dec 10, 2024
1 parent dc4c2c1 commit e27392d
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ if development {
dependencies = [
"CCryptoBoringSSL",
"CCryptoBoringSSLShims",
"CryptoBoringWrapper"
"CryptoBoringWrapper",
]
} else {
let platforms: [Platform] = [
Expand All @@ -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)),
]
}

Expand Down Expand Up @@ -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: [
Expand All @@ -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])),
]
),
Expand Down Expand Up @@ -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
Expand All @@ -156,10 +159,10 @@ let package = Package(
name: "CryptoBoringWrapper",
dependencies: [
"CCryptoBoringSSL",
"CCryptoBoringSSLShims"
"CCryptoBoringSSLShims",
],
exclude: privacyManifestExclude + [
"CMakeLists.txt",
"CMakeLists.txt"
],
resources: privacyManifestResource
),
Expand All @@ -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
),
Expand All @@ -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
}
}

0 comments on commit e27392d

Please sign in to comment.